gcd=list(map(int,input().split()))

if gcd[0]<gcd[1]:
	gcd[0],gcd[1]=gcd[1],gcd[0]
while gcd[1]>0:
	r=gcd[0]%gcd[1]
	gcd[0]=gcd[1]
	gcd[1]=r
print(gcd[0])
 gcd=list(map(int,input().split())) gcd list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split if gcd[0]<gcd[1]:
	gcd[0],gcd[1]=gcd[1],gcd[0] gcd[0]<gcd[1] gcd[0] gcd 0 gcd[1] gcd 1 gcd[0],gcd[1]=gcd[1],gcd[0] gcd[0] gcd 0 gcd[1] gcd 1 gcd[1] gcd 1 gcd[0] gcd 0 while gcd[1]>0:
	r=gcd[0]%gcd[1]
	gcd[0]=gcd[1]
	gcd[1]=r gcd[1]>0 gcd[1] gcd 1 0 r=gcd[0]%gcd[1] r gcd[0]%gcd[1] gcd[0] gcd 0 gcd[1] gcd 1 gcd[0]=gcd[1] gcd[0] gcd 0 gcd[1] gcd 1 gcd[1]=r gcd[1] gcd 1 r print(gcd[0]) print gcd[0] gcd 0 gcd=list(map(int,input().split())) list(map(int,input().split())) gcd r=gcd[0]%gcd[1] gcd[0]%gcd[1] r
gcd=list(map(int,input().split()))

if gcd[0]<gcd[1]:
	gcd[0],gcd[1]=gcd[1],gcd[0]
while gcd[1]>0:
	r=gcd[0]%gcd[1]
	gcd[0]=gcd[1]
	gcd[1]=r
print(gcd[0])

