
#include <iostream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <typeinfo>
using namespace std;

int main(){
    int zero = '0';
    int cnt = 0;
    string load[4];
    int j=0, i=0;
    bool end = false;
    while(1){
        cnt=0;
        for(i=0;i<8;i++){
            cin >>load[0];
            if(cin.eof()){
                end = true;
                break;
            }
            cnt ++;
            int k=0;
            for(int l=0;l<8;l++){
                k += load[0][l]-zero;
            }
            if (k>0){
                break;
            }
        }
        if(end){break;}
        for(j=1;(j+i<7)&&(j<4);j++){
            cin >>load[j];
            cnt ++;
            if(j+i==7){cnt=10;}
        }
        int trash=0;
        while((cin>>trash)&&(cnt<7)){cnt ++;}
        int index=0;
        for(i=0;i<8;i++){
            if(load[0][i]=='1'){
                index = i;
                break;
            }
        }
        string out = "poo";
        if(index<=6){
            if(load[0][index+1]=='1'){
                if((index<=4)&&(load[0][index+2])=='1'){
                    out = "C";
                }
                else if(i<=6){
                    if(load[1][index]=='1'){
                        if(load[1][index+1]=='1'){
                            out = "A";
                        }
                        else{out="G";}
                    }
                    else if(load[1][index+1]){
                        out ="E";
                    }
                }
            }
            else if(load[1][index]=='1'){
                if((j>=2)&&(load[2][index]=='1')){
                    out = "B";
                }
                else if(load[1][index+1]=='1'){
                    out = "F";
                }
                else{
                    out = "D";
                }
            }
        }
        else{
            if(load[1][index-1]=='1'){
                out = "D";
            }
            else{
                out = "B";
            }
        }
        cout <<out <<endl;
    }
    return 0;

}