#include <iostream>using namespace std;int main(){ int a,b,r=1,p; while(cin>>a>>b) { while(r<=a) { if(a%r==0&&b%r==0) p=r; r++; } cout<<p<<endl; } }