#41465: python


suyueh (suyueh)


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