#43653: ____


yp11251144@yphs.tp.edu.tw (911-38曾湛)


#include <bits/stdc++.h>
                                                                                 
using namespace std;
                                                                 
int main()
{
int a,b,k;
while(cin>>a>>b){
while(a%b){
k=a%b;
a=b;
b=k;
}
cout<<b<<endl;
}
                           
}

hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh