a,b=map(int,input().split())

if a<b:
	(a,b)=(b,a)

while b!=0:
	(a,b)=(b,a%b)

print(a) a,b=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b if a<b:
	(a,b)=(b,a) a<b a b (a,b)=(b,a) (a,b) a b (b,a) b a while b!=0:
	(a,b)=(b,a%b) b!=0 b 0 (a,b)=(b,a%b) (a,b) a b (b,a%b) b a%b a b print(a) print a a,b=map(int,input().split()) map(int,input().split()) a b=map(int,input().split()) map(int,input().split()) b
a,b=map(int,input().split())

if a<b:
	(a,b)=(b,a)

while b!=0:
	(a,b)=(b,a%b)

print(a)