#include<iostream>using namespace std;
long _gcd(long a,long b){ return b?_gcd(b,a%b):a;}int main(){ long x=0,y=0,gcd=0; while(cin >> x >> y){ gcd=_gcd(x,y); cout << gcd << "\n"; } return 0;}