a = 30
b = 12
while b != 0:
    temp = b
    b = a % b
    a = temp
print(a)