import math from functools import reduce def gcd(*numbers): return reduce(math.gcd, numbers) x=map(int,input().split()) print(gcd(x))