#include<iostream>
#include<string.h>
#include<vector>
#include<list>
#include<stdio.h>
#include<math.h>
#include<iomanip>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug " << x << endl;
using namespace std;

int main(){
    char m[15][15] = {'0'};
    bool check = true;
    while(check){
        range(i,4,12){
            if(cin >> m[i]){
                ;
            }else{
                check = false;
            }
        }
        range(i,4,12){
            range(j,0,8){
                if(m[i][j] == '1' && m[i+1][j] == '1' && m[i][j+1] == '1' && m[i+1][j+1] == '1'){
                     cout << 'A' << endl;
                      break;
                }
                if(m[i][j] == '1' && m[i+1][j] == '1' && m[i+2][j] == '1' && m[i+3][j] == '1'){
                     cout << 'B' << endl;
                      break;
                }
                if(m[i][j] == '1' && m[i][j+1] == '1' && m[i][j+2] == '1' && m[i][j+3] == '1'){
                     cout << 'C' << endl;
                      break;
                }
                if(m[i][j] == '1' && m[i+1][j] == '1' && m[i-1][j+1] == '1' && m[i-2][j+1] == '1'){
                     cout << 'D' << endl;
                      break;
                }
                if(m[i][j] == '1' && m[i][j+1] == '1' && m[i+1][j+1] == '1' && m[i+1][j+2] == '1'){
                     cout << 'E' << endl;
                      break;
                }
                if(m[i][j] == '1' && m[i+1][j] == '1' && m[i+1][j+1] == '1' && m[i+2][j+1] == '1'){
                     cout << 'F' << endl;
                      break;
                }
                if(m[i][j] == '1' && m[i][j+1] == '1' && m[i+1][j-1] == '1' && m[i+1][j] == '1'){
                     cout << 'G' << endl;
                      break;
                }
            }
        }
    }
}