#35688: Python 使用math.gcd() ----> AC


henry.curry1008@gmail.com (Henry Huang)


import math
while True:
    try:
        a, b = map(int,input().split())
        print(math.gcd(a, b))
    except:
        break