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

while a % b != 0:

	a,b = b, a % b

print(b)
def gcm(x,y):

    while y:

        x, y = y, x % y

    return x



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

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

def gcm(x, y):
    while y:
        x, y = y, x % y
    return x


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

+def gcm(x, y): +    while y: +        x, y = y, x % y +    return x + + -while a % b != 0: -    a, b = b, a % b -print(b) +print((gcm(a, b)))