y,x = sorted([int(s) for s in input().split()])

while y:
	x,y = y,x%y
print(x) int(s) for s in input().split() for s in input().split() s input().split() ().split () input split for s in input().split() int(s) int s y,x = sorted([int(s) for s in input().split()]) y sorted([int(s) for s in input().split()]) sorted [int(s) for s in input().split()] x while y:
	x,y = y,x%y y x,y = y,x%y x y y x%y x y print(x) print x x = sorted([int(s) for s in input().split()]) sorted([int(s) for s in input().split()]) x x,y = y,x%y y x y,x = sorted([int(s) for s in input().split()]) sorted([int(s) for s in input().split()]) y y = y,x%y x%y y
y,x = sorted([int(s) for s in input().split()])

while y:
	x,y = y,x%y
print(x)