#!/usr/local/bin/ruby
# -*- coding: euc-jp -*-
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 and j <=6
            if a[i+1][j]==1 and a[i+1][j+1]==1 and i <= 6 and j <= 6
               puts "A"
            elsif a[i][j+2]==1 and a[i][j+3]==1 and j <= 4
               puts "C"
            elsif a[i+1][j+1]==1 and a[i+1][j+2]==1 and i <= 6 and j <= 5
               puts "E"
            elsif a[i+1][j-1]==1 and a[i+1][j]==1 and j >=1 and i <= 6
               puts "G"
            elsif a[i-1][j+1]==1 and a[i+1][j]==1 and i >= 1 and i <= 6 and j <= 6
               puts "D"
            elsif a[i-1][j]==1 and a[i+1][j+1]==1 and i >= 1 and i <= 6 and j <= 6
               puts "F"
            end
         end
         if a[i][j]==1 and a[i+1][j]==1 and a[i+2][j]==1 and a[i+3][j]==1 and i <= 4 
            puts "B"
         end
      end
   end
end