def gcd(a,b): if b==0: print(a) return None return gcd(b,a%b) (lambda x:gcd(x[0],x[1]))(list(map(int,input().split())))