from yogi import *


for a in tokens(int):
    b = read(int)
    print(mcd(a, b))
