#!/usr/local/bin/ruby
while true
  a=Array.new(8){Array.new(8)}
   for i in 0..7
      b = gets.split("").map(&:to_i)
      for j in 0..7
         a[i][j]=b[j]
       end
   end
   
   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 ) 
              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 and a[i+3][j]==1 )
            puts "B"
         end
      end
   end
end