#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int Gcd(__int64 x,__int64 y) { if(y==0) return x; else return Gcd(y,x%y); } int main() { __int64 x,y,t,m; while(cin>>x>>y&&(x||y)) { if(x