#include<iostream>
#include<string>
#include<vector>
#define MAX 8
using namespace std;

int main(void){
  vector<vector<char> > inp(MAX,vector<char>(MAX));
  vector<vector<int> > buf(MAX,vector<int>(MAX));
  while(cin>>inp[0][0]){
    buf[0][0]=inp[0][0]-'0';
    for(int i = 1 ; i < MAX ; i ++){
      cin>>inp[0][i];
      buf[0][i]=inp[0][i]-'0';
    }
    for(int i = 1 ; i < MAX ; i ++)
      for(int j = 0 ; j < MAX ; j ++){
        cin>>inp[i][j];
        buf[i][j]=inp[i][j]-'0'; 
      }
//cout<<buf[0][3]<<" "<<buf[0][6]<<endl;
    
    bool find=false;
    char ans;
    for(int i = 0 ; i < MAX ; i ++){
      if(find)break;
      for(int j = 0 ; j < MAX ; j ++){
        if(buf[i][j]){
          ans='O';
          if(0<=i&&i<MAX-1 && 0<=j&&j<MAX-1&&buf[i+1][j]&&buf[i][j+1]&&buf[i+1][j+1])ans='A';
          else if(0<=i&&i<MAX-3 && 0<=j&&j<MAX&&buf[i+3][j])ans='B';
          else if(0<=i&&i<MAX && 0<=j&&j<MAX-3&&buf[i][j+3])ans='C';
          else if(0+1<=i&&i<MAX-1 && 0<=j&&j<MAX-2&&buf[i-1][j+2])ans='D';
          else if(0<=i&&i<MAX-1 && 0<=j&&j<MAX-2&&buf[i+1][j+2])ans='E';
          else if(0<=i&&i<MAX-2 && 0<=j&&j<MAX-1&&buf[i+2][j+1])ans='F';
          else if(0+1<=i&&i<MAX-1 && 0<=j&&j<MAX-1&&buf[i][j+1]&&buf[i+1][j-1])ans='G';
          find = true;
          break;
        } 
      }
    }
    cout<<ans<<endl;
    
  }
}