gcd(a,b)=gcd(b,a%b) 假设a>b;
#include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;
int gcd(int a, int b)
{
return !b? a:gcd(b,a%b);
}
int main()
{
int a,b;
while(scanf("%d%d",&a,&b)!=EOF&&(a+b)){
printf("%d\n",gcd(a,b));
}
return 0;
}