#include<iostream>
#include<string>
#include<vector>
#include<cstdio>
#include<sstream>
#include<algorithm>
#include<cmath>
#include<map>
#include<functional>
#include<queue>
#include<stack>
#include<set>
using namespace std;
int stoi(string x){stringstream ss;ss<<x;int tmp;ss>>tmp;return tmp;}
string itos(int x){stringstream ss;ss<<x;return ss.str();}
char ta[12][12];

bool ok(int y,int x){
	if(y<0||x<0||y>7||x>7)return 0;
	if(ta[y][x]=='1')return 1;
	return 0;
}
int main(){

while(cin>>ta[0][0]){
	int y,x;
	bool f=1;
	for(int i=0;i<8;i++){
		for(int j=(i==0);j<8;j++){
			char now;
			cin>>now;
			if(now=='1'&&f){y=i,x=j;f=0;}
			ta[i][j]=now;
		}
	}
	//for(int i=0;i<8;i++){for(int j=0;j<8;j++){cout<<ta[i][j];}cout<<endl;}
	if( ok(y,x+1)&ok(y+1,x)&&ok(y+1,x+1) )cout<<"A";
	
	else if( ok(y+1,x)&&ok(y+2,x)&&ok(y+3,x) )cout<<"B";
	
	else if( ok(y,x+1)&&ok(y,x+2)&&ok(y,x+3) )cout<<"C";
	
	else if( ok(y,x+1)&ok(y+1,x+1)&&ok(y+1,x+2) )cout<<"E";
	
	else if( ok(y+1,x)&&ok(y+1,x+1) &&ok(y+2,x+1))cout<<"F";
	
	else if( ok(y,x+1)&&ok(y+1,x)&&ok(y+1,x-1) )cout<<"G";
	
	else if( ok(y+2,x-1)&&ok(y+1,x-1)&&ok(y+1,x))cout<<"D";

	cout<<endl;
		for(int i=0;i<8;i++)for(int j=0;j<8;j++)ta[i][j]='0';
}
	
	return 0;
}