class MyArray < Array
  def [](other)
    if other >= self.length or other < 0
      super other % self.length
    else
      super
    end
  end
end
flag = true
while flag
  arr = [MyArray.new(gets.split(//).map(&:to_i))]
  7.times do 
    arr << MyArray.new(gets.split(//).map(&:to_i))
  end
  i = 0
  while arr[i].select{|i|i == 1}.size == 0
    i += 1
  end
  if arr[i].select{|i|i == 1}.size == 4
    puts "C"
  elsif arr[i].select{|i|i == 1}.size == 2
    if arr[i + 1][arr[i].index(1)] == 1
      if arr[i + 1][arr[i].index(1) + 1] == 1
        puts "A"
      else
        puts "G"
      end
    else
      puts "E"
    end
  else
    if arr[i + 2][arr[i].index(1)] == 1
      puts "B"
    elsif arr[i + 2][arr[i].index(1) + 1] == 1
      puts "F"
    else
      puts "D"
    end
  end
  flag = gets
end