def euclid n
  until n[1] == 0
    tmp = n[0]
    n[0] = n[1]
    n[1] = tmp % n[1]
  end
  n[0]
end


while input = $stdin.gets
  n = input.chomp.split(" ").map(&:to_i).sort!{|a,b| b <=> a}
  p euclid(n)
end