reader = (list(map(int, input().split(' ')))) wa = reader[0] + reader[1] seki = reader[0] * reader[1] result = 0 for i in range(1, seki): if wa % i == 0 and seki % i == 0: result = i print(result)