loop do
  l = (1..8).map{gets.chomp}.join
  puts "A" if l =~ /1100000011/
  puts "B" if l =~ /1000000010000000100000001/
  puts "C" if l =~ /1111/
  puts "D" if l =~ /1000000110000001/
  puts "E" if l =~ /11000000011/
  puts "F" if l =~ /100000001100000001/
  puts "G" if l =~ /110000011/
  break unless gets
end