str_input = input()
list_input = str_input.split(" ")
x = int(list_input[0])
y = int(list_input[1])
while y != 0:
    mod = x % y
    x = y
    y = mod
print(x)
 str_input = input() str_input input() input list_input = str_input.split(" ") list_input str_input.split(" ") str_input.split str_input split " " x = int(list_input[0]) x int(list_input[0]) int list_input[0] list_input 0 y = int(list_input[1]) y int(list_input[1]) int list_input[1] list_input 1 while y != 0:
    mod = x % y
    x = y
    y = mod y != 0 y 0 mod = x % y mod x % y x y x = y x y y = mod y mod print(x) print x y = mod mod y str_input = input() input() str_input list_input = str_input.split(" ") str_input.split(" ") list_input y = int(list_input[1]) int(list_input[1]) y mod = x % y x % y mod x = y y x x = int(list_input[0]) int(list_input[0]) x
str_input = input()
list_input = str_input.split(" ")
x = int(list_input[0])
y = int(list_input[1])
while y != 0:
    mod = x % y
    x = y
    y = mod
print(x)

