#include <iostream>
#include <string>
using namespace std;
int main(){
 int b[5][4];
 int sx,sy;
 int x,y;
 string line;
 while(true){
 for(int i=0;i<20;i++)b[i%5][i/5] = 0;
 sx=sy=-1;
 for(y=0;y<8;y++){
 if (!(cin>>line))break;
 for(x=0;x<8;x++){
 if (line[x]=='1'){
 if (sy==-1){sx=x-1;sy=y;}
 b[x-sx][y-sy] = 1;
 }
 }
 }
 if (y<8)break;
 if(b[2][0]&&b[1][1]&&b[2][1])cout<<"A"<<endl;
 if(b[1][3])cout<<"B"<<endl;
 if(b[4][0])cout<<"C"<<endl;
 if(b[0][2])cout<<"D"<<endl;
 if(b[3][1])cout<<"E"<<endl;
 if(b[2][2])cout<<"F"<<endl;
 if(b[0][1]&&b[2][0])cout<<"G"<<endl;
 }}