#include<iostream>
using namespace std;

void Select_Figure( char s[14][14] )
{
    for( int i = 3; i < 11; i++ )
    {
        for( int j = 3; j < 11; j++ )
        {
            if( s[i][j] == '1' )
            {
                if( s[i][j+1] == '1' && s[i+1][j] == '1' && s[i+1][j+1] == '1' )
                    cout << 'A' << endl;
                else if ( s[i+1][j] == '1' && s[i+2][j] == '1' && s[i+3][j] == '1' )
                    cout << 'B' << endl;
                else if ( s[i][j+1] == '1' && s[i][j+2] == '1' && s[i][j+3] == '1' )
                    cout << 'C' << endl;
                else if ( s[i+1][j] == '1' && s[i+1][j-1] == '1' && s[i+2][j-1] == '1' )
                    cout << 'D' << endl;
                else if ( s[i][j+1] == '1' && s[i+1][j+1] == '1' && s[i+1][j+2] == '1' )
                    cout << 'E' << endl;
                else if ( s[i+1][j] == '1' && s[i+1][j+1] == '1' && s[i+2][j+1] == '1' )
                    cout << 'F' << endl;
                else if ( s[i][j+1] == '1' && s[i+1][j] == '1' && s[i+1][j-1] == '1' )
                    cout << 'G' << endl;
                else;
                return;
            }
        }
    }
}

int main()
{
    char s[14][14];         //数字の間に区切りが無いからchar型で読み込む。大事。
    
    for( int k = 0; k < 50; k++ )
    {
        //初期化
        for( int i = 0; i < 14; i++ )
            for( int j = 0; j < 14; j++ )
                s[i][j] = 0;
        
        for( int i = 3; i < 11; i++ )
            for( int j = 3; j < 11; j++ )
                cin >> s[i][j];
            
        Select_Figure( s );
    }

    return 0;
}
