#inlcude <stdio.h>
int greatest_common_divisor(int u, int v)
{
int t;
while ( u > 0 )
{
if( u < v )
{
t = u;
u = v;
v = t;
}
u = u - v;
}
return v;
}
main()
{
int x, y;
while (scanf("%d %d", &x, &y) != EOF)
{
if(x > 0 && y > 0)
{
printf("%d %d = %d \n", x, y, greatest_common_divisor(x, y));
}
}
}