import math
line=input().split()
x=int(line[0])
y=int(line[1])
print(math.gcd(x,y))
 import math math line=input().split() line input().split() ().split () input split x=int(line[0]) x int(line[0]) int line[0] line 0 y=int(line[1]) y int(line[1]) int line[1] line 1 print(math.gcd(x,y)) print math.gcd(x,y) math.gcd math gcd x y y=int(line[1]) int(line[1]) y x=int(line[0]) int(line[0]) x line=input().split() input().split() line
import math
line=input().split()
x=int(line[0])
y=int(line[1])
print(math.gcd(x,y))

