#!/usr/local/bin/ruby
while true
  a=Array.new(9){Array.new(9)}
  for s in 0..7
    b = gets.chop!.split("").map(&:to_i)
       # puts"#{b}"
    for t in 0..7
      a[s][t] = b[t]
    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 and a[i+1][j] == 1 and a[i+1][j+1] == 1 )
        puts "A"
      elsif ( a[i][j] == 1 and a[i][j+1]==1 and a[i][j+2] == 1 and a[i][j+3] == 1)
        puts "C"
      elsif ( a[i][j] == 1 and a[i][j+1]==1 and a[i+1][j+1] == 1 and a[i+1][j+2] == 1)
        puts "E"
      elsif ( a[i][j+1] == 1 and a[i][j+2]==1 and a[i+1][j] == 1 and a[i+1][j+1] == 1)
        puts "G"
      elsif ( a[i][j+1] == 1 and a[i][j]==1 and a[i][j+1] == 1 and a[i+1][j] == 1)
        puts "D"
      elsif ( a[i][j] == 1 and a[i+1][j]==1 and a[i+1][j+1] == 1 and a[i+2][j+1] == 1)
        puts "F"
      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