#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include <string>
#include <string.h>
#include <vector>
using namespace std;
//1056
int x,y;
int main(){
while(scanf("%d %d",&x,&y)!=EOF){
int ans=-1;
for(int i=1;i<=min(x,y);i++)
if(x%i==0&&y%i==0){
if(i>ans) ans=i;
}
printf("%d\n",ans);
}
return 0;
}
/**************************************************************
Problem: 1056
User: cust123
Language: C++
Result: Accepted
Time:0 ms
Memory:1520 kb
****************************************************************/
09-05
329

03-22
223
