x, y = list(map(int, input().split()))

if x < y:

    x,y = y,x

while y:

    x,y = y, x%y

print(x)  
a,b=list(map(int,input().split()))

while b:

 a,b=b,a%b

print(a)
x, y = list(map(int, input().split()))
if x < y:
    x, y = y, x
while y:
    x, y = y, x % y
print(x)

a, b = list(map(int, input().split()))
while b:
    a, b = b, a % b
print(a)

-x, y = list(map(int, input().split())) -if x < y: -    x, y = y, x -while y: -    x, y = y, x % y -print(x) +a, b = list(map(int, input().split())) +while b: +    a, b = b, a % b +print(a)