#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(x) (x).begin(),(x).end()
#define pb push_back
#define mp make_pair
#define fir first
#define sec second
#define ub upper_bound
#define lb lower_bound
#define int long long
using namespace std;
const int MOD=1000000007;
const int INF=1000000009;



signed main(){
  char M[10][10];
  while(cin>>M[0][0]){
    loop(i,1,8)cin>>M[0][i];
    loop(i,1,8)rep(j,8)cin>>M[i][j];
    bool A=false,B=false,C=false,D=false,E=false,F=false,G=false;
    rep(i,7)rep(j,7){
      if(M[i][j]=='1'&&M[i][j+1]=='1'&&M[i+1][j]=='1'&&M[i+1][j+1]=='1'){
        A=true;
        goto at;
      }
    }
    rep(i,4)rep(j,8){
      if(M[i][j]=='1'&&M[i+1][j]=='1'&&M[i+2][j]=='1'&&M[i+3][j]=='1'){
        B=true;
        goto at;
      }
    }
    rep(i,8)rep(j,4){
      if(M[i][j]=='1'&&M[i][j+1]=='1'&&M[i][j+2]=='1'&&M[i][j+3]=='1'){
        C=true;
        goto at;
      }
    }
    rep(i,7)loop(j,1,8){
      if(M[i][j]=='1'&&M[i+1][j]=='1'&&M[i+1][j-1]=='1'&&M[i+2][j-1]=='1'){
        D=true;
        goto at;
      }
    }
    rep(i,7)rep(j,6){
      if(M[i][j]=='1'&&M[i][j+1]=='1'&&M[i+1][j+1]=='1'&&M[i+1][j+2]=='1'){
        E=true;
        goto at;
      }
    }
    rep(i,6)rep(j,7){
      if(M[i][j]=='1'&&M[i+1][j]=='1'&&M[i+1][j=1]=='1'&&M[i+2][j+1]=='1'){
        F=true;
        goto at;
      }
    }
    rep(i,7)loop(j,1,7){
      if(M[i][j]=='1'&&M[i][j+1]=='1'&&M[i+1][j]=='1'&&M[i+1][j-1]=='1'){
        G=true;
        break;
      }
    }
    cout<<'a'<<endl;
    at: ;
    if(A)cout<<'A'<<endl;
    if(B)cout<<'B'<<endl;
    if(C)cout<<'C'<<endl;
    if(D)cout<<'D'<<endl;
    if(E)cout<<'E'<<endl;
    if(F)cout<<'F'<<endl;
    if(G)cout<<'G'<<endl;
  }
  return 0;
}