import sysgcd = lambda a, b: gcd(b, a % b) if b else afor s in sys.stdin: print(gcd(*map(int, s.strip().split(" "))))