while a = [] and (a << gets.split.map(&:to_i).inject { |sum, x| sum + x } )[0] != 0
  4.times { a << gets.split.map(&:to_i).inject { |sum, x| sum + x } }
  puts ["ABCDE"[ a.index a.max ], a.max].join(" ")
end