#include <cstdio>
using namespace std;

char c[8][12];

int find(){
    int i = 0;
    while( c[i/8][i%8] == '0' ) i++;
    return i;
}

int main(){
    const char O = '1', Z = '0';
    while( true ){
        int i = 0;
        while( i < 8 && scanf("%s", c[i]) != EOF ){
            i++;
        }
        if( i < 8 ) break;
        int p = find();
        if( c[p/8][p%8+1] == O && c[p/8+1][p%8] == O ){
            if( c[p/8+1][p%8+1] == O ) puts("A");
            else puts("G");
        }
        if( c[p/8+2][p%8] == O ) puts("B");
        if( c[p/8][p%8+2] == O ) puts("C");
        if( c[p/8+1][p%8] == O && c[p/8+2][p%8] == Z &&
            c[p/8][p%8+1] == Z ){
            if( c[p/8+1][p%8+1] == Z ) puts("D");
            else puts("F");
        }
        if( c[p/8+1][p%8] == Z && c[p/8+1][p%8+1] == O ) puts("E");
        scanf("");
    }
    return 0;
}