#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define LOOP(i,x,n) for(int i=x;i<n;i++)
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define MP make_pair
#define FR first
#define SC second
#define int long long
const double eps=1e-10;
using namespace std;
const int MOD=1000000007;
const int INF=9000000009;



signed main(){
  string s[10];
  while(cin>>s[0]){
    REP(i,7)cin>>s[i+1];

    REP(i,7)REP(j,7){
      if(s[i][j]=='1'&&s[i][j+1]=='1'&&s[i+1][j]=='1'&&s[i+1][j+1]=='1'){
        cout<<"A"<<endl;
        break;
      }
    }

    REP(i,5)REP(j,8){
      if(s[i][j]=='1'&&s[i+1][j]=='1'&&s[i+2][j]=='1'&&s[i+3][j]=='1'){
        cout<<"B"<<endl;
        break;
      }
    }

    REP(i,8)REP(j,5){
      if(s[i][j]=='1'&&s[i][j+1]=='1'&&s[i][j+2]=='1'&&s[i][j+3]=='1'){
        cout<<"C"<<endl;
        break;
      }
    }

    REP(i,6)REP(j,7){
      if(s[i][j+1]=='1'&&s[i+1][j]=='1'&&s[i+1][j+1]=='1'&&s[i+2][j]=='1'){
        cout<<"D"<<endl;
        break;
      }
    }

    REP(i,7)REP(j,6){
      if(s[i][j]=='1'&&s[i][j+1]=='1'&&s[i+1][j+1]=='1'&&s[i+1][j+2]=='1'){
        cout<<"E"<<endl;
        break;
      }
    }

    REP(i,6)REP(j,7){
      if(s[i][j]=='1'&&s[i+1][j]=='1'&&s[i+1][j+1]=='1'&&s[i+2][j+1]=='1'){
        cout<<"F"<<endl;
        break;
      }
    }

    REP(i,6)REP(j,7){
      if(s[i][j+1]=='1'&&s[i][j+2]=='1'&&s[i+1][j]=='1'&&s[i+1][j+1]=='1'){
        cout<<"G"<<endl;
        break;
      }
    }
  }
  return 0;
}

