while true
    k=0
    arr=Array.new
    8.times do
        arr<<gets.chomp.split(//).map(&:to_i)
    end
    gets
    while true
        if(arr[k].find_all{|i|i==1}.size==4)
            puts "C"
            break
        elsif(arr[k].find_all{|i|i==1}.size==2)
            if(arr[k+1][arr[k].index(1)]==1)
                if(arr[k+1][arr[k].index(1)+1]==1)
                    puts "A"
                    break
                else
                    puts "G"
                    break
                end
            else
                puts"E"
                break
            end
        elsif(arr[k].find_all{|i|i==1}.size==1)
            if(arr[k+1][arr[k].index(1)+1]==1)
                puts "F"
                break
            elsif(arr[k+1][arr[k].index(1)-1]==1)
                puts "D"
                break
            else
                puts "B"
                break
            end
        else
            k+=1
        end
    end
end