a = input()
b = input()

while True:
    R = a % b
    if (R == 0):
        break
    else:
        a = b
        b = R

print(b)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: