#!/usr/local/bin/ruby
while true
  a=Array.new(8){Array.new(8)}
  for i in 0..7
    b = gets.chop!.split("").map(&:to_i)
   # puts"#{b}"
    for j in 0..7
      a[i][j]=b[j]
    end
  end
 # puts "#{a}"
  for i in 0..7
    for j in 0..7
      if (a[i][j]==1 and a[i][j+1]==1 )
        if (a[i+1][j]==1 and a[i+1][j+1]==1 )
          puts "A"
        elsif (a[i][j+2]==1 and a[i][j+3]==1 )
          puts "C"
        elsif(a[i+1][j+1]==1 and a[i+1][j+2]==1 )
          puts "E"
        elsif (a[i+1][j-1]==1 and a[i+1][j]==1 and i) 
          puts "G"
        elsif (a[i-1][j+1]==1 and a[i+1][j]==1 )
          puts "D"
        elsif (a[i-1][j]==1 and a[i+1][j+1]==1 )
          puts "F"
        end
      elsif( a[i][j]==1 and a[i+1][j]==1 and a[i+2][j]==1 )
        puts "B"
      end
    end
  end
end