#include<iostream>
#include<string>
using namespace std;

int main(){
	string line[8];



	int w = 0, h = 0, t=-1;

	for(int i=0;i<8;++i)
		cin >> line[i];

	int right=0,left=7;

	for(int i=0;i<8;++i){
		bool exist = false;
		for(int j=0;j<8;++j){
			if((line[i])[j] == '1'){
				if(t!=-1)t=i;
				if(j>right)right = j;
				if(j<left)left = j;
				exist = true;
			}
		}
		if(exist)++h;
	}
	w = right - left + 1;

	if( w == 2 && h == 2 )cout<<"A"<<endl;
	else if(w == 1)cout<<"B"<<endl;
	else if(h == 1)cout<<"C"<<endl;


	else if(w==2){
		for(int i=0;i<8;++i){
			if((line[i])[left] == '1'){
				if((line[i])[left+1]=='1')
					cout<<"D"<<endl;
				else
					cout<<"F"<<endl;
				break;
			}
		}
	}

	else if(h==2){
		for(int i=0;i<8;++i){
			if((line[t])[i]=='1'){
				if((line[t+1])[i]=='1')
					cout<<"G"<<endl;
				else
					cout<<"E"<<endl;
			}
		}
	}
	return 0;
}