a,b=map(int,input().split(' '))
GCD=1
i=1
while i<=a and i<=b:
if a%i==0 and b%i==0:
GCD=i
i+=1
print(GCD)
a,b=map(int,input().split(' ')) GCD=1 i=1 while i<=a and i<=b: if a%i==0 and b%i==0: GCD=i i+=1 print(GCD)
用輾轉相除法