#35949: python解題(函數)


11360643@me.mcu.edu.tw (11360643 11360643)


from math import gcd
a,b=map(int,input().split())
print(gcd(a,b))