#34453: 真是輕鬆加愉快


yp11151246@yphs.tp.edu.tw (911-44謝曜宇)


#include<iostream>
using namespace std;
int main(){
int a,b;
while(cin>>a>>b){
while(a!=0 && b!=0) (a>b) ? a=a%b : b=b%a;
cout << (a==0 ? b : a) << endl;
}
      return 0;
}