import math def main(): nums = [] for i in range(3): nums.append(int(input())) print(math.gcd(*nums)) if __name__ == '__main__': main()