from fractions import gcd

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

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

while y != 0:

    x, y = y, x % y

print(x)
from fractions import gcd

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

x, y = list(map(int, input().split()))
while y != 0:
    x, y = y, x % y
print(x)

-from fractions import gcd - -print((gcd(x, y))) +while y != 0: +    x, y = y, x % y +print(x)