def get_first_point(arr)
  arr.each_with_index do |a, idx|
    return idx if a == 1
  end
  raise 'Not found first point'
end

def match_figure?(arr, figure)
  first_point = get_first_point(arr)
  figure.each do |i|
    return false if arr[first_point + i] == 0
  end
  return true
end

loop do
  arr = []
  1.upto(8) do
    tmp = gets
    break unless tmp
    arr += tmp.chomp.split('').map(&:to_i)
  end
  break if arr.size != 64

  if match_figure?(arr, [1,8,9])
    puts 'A'
  elsif match_figure?(arr, [8,16,24])
    puts 'B'
  elsif match_figure?(arr, [1,2,3])
    puts 'C'
  elsif match_figure?(arr, [7,8,15])
    puts 'D'
  elsif match_figure?(arr, [1,9,10])
    puts 'E'
  elsif match_figure?(arr, [8,9,17])
    puts 'F'
  elsif match_figure?(arr, [1,7,8])
    puts 'G'
  end

  # ????¬?????????????
  gets
end