#include <iostream>
#include <string>
using namespace std;
int main(){
	while(1){
		int b[8][8]={0};
		string str;
		for(int i=0;i<8;i++){
			cin>>str;
			for(int j=0;j<8;j++){
				b[i][j]=str[j]-48;
			}
		}
		int x;
		for(int i=0;i<8;i++){
			for(int j=0;j<8;j++){
				if(b[i][j] && b[i+1][j] && b[i][j+1] && b[i+1][j+1]) x=1;
				else if(b[i][j] && b[i+1][j] && b[i+2][j] && b[i+3][j]) x=2;
				else if(b[i][j] && b[i][j+1] && b[i][j+2] && b[i][j+3]) x=3;
				else if(b[i][j] && b[i+1][j] && b[i+1][j-1] && b[i+2][j-1]) x=4;
				else if(b[i][j] && b[i][j+1] && b[i+1][j+1] && b[i+1][j+2]) x=5;
				else if(b[i][j] && b[i+1][j] && b[i+1][j+1] && b[i+2][j+1]) x=6;
				else if(b[i][j] && b[i][j+1] && b[i+1][j] && b[i+1][j-1]) x=7;
			}
		}
		switch(x){
		case 1:
			cout<<"A"<<endl;
			break;
		case 2:
			cout<<"B"<<endl;
			break;
		case 3:
			cout<<"C"<<endl;
			break;
		case 4:
			cout<<"D"<<endl;
			break;
		case 5:
			cout<<"E"<<endl;
			break;
		case 6:
			cout<<"F"<<endl;
			break;
		case 7:
			cout<<"G"<<endl;
			break;
		}
	}
	return 0;
}