a,b=input().split() a=int(a) b=int(b) if b>a: a,b=b,a for i in range(1,a): if a%i==0 and b%i==0: c=i print(c)