#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;
			}
		}
		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]){
					cout<<"A"<<endl;
					goto label;
				}else if(b[i][j] && b[i+1][j] && b[i+2][j] && b[i+3][j]){ 
					cout<<"B"<<endl;
					goto label;
				}else if(b[i][j] && b[i][j+1] && b[i][j+2] && b[i][j+3]){
					cout<<"C"<<endl;
					goto label;
				}else if(b[i][j] && b[i+1][j] && b[i+1][j-1] && b[i+2][j-1]){
					cout<<"D"<<endl;
					goto label;
				}else if(b[i][j] && b[i][j+1] && b[i+1][j+1] && b[i+1][j+2]){
					cout<<"E"<<endl;
					goto label;
				}else if(b[i][j] && b[i+1][j] && b[i+1][j+1] && b[i+2][j+1]){
					cout<<"F"<<endl;
					goto label;
				}else if(b[i][j] && b[i][j+1] && b[i+1][j] && b[i+1][j-1]){ 
					cout<<"G"<<endl;
					goto label;
				}
			}
		}
		label:;
	}
	return 0;
}