num1=int(raw_input("enter a number"))
num2=int(raw_input("enter a second number"))
while num2!=0:
    num1,num2=num2,num1%num2
print num1  



num1=int(raw_input("enter a number"))
num2=int(raw_input("enter a number"))
while num2!=0:
    num1,num2=num2,num1%num2
    print num1