/* problem 36 */

#include<iostream>

using namespace std;

char board[8][9];

int isA(int x,int y){
	if(y==7){
		return 0;
	}
	else if(board[y][x] == '1' && board[y+1][x] == '1' && board[y][x+1]=='1'&&
		board[y+1][x+1] == '1'){
			return 1;
	}
	else{
		return 0;
	}
}

int isB(int x,int y){
	if(y >= 5){
		return 0;
	}
	else if(board[y][x] == '1' && board[y+1][x] == '1' &&
		board[y+2][x] == '1' && board[y+3][x] == '1'){
			return 1;
	}
	else{
		return 0;
	}
}
int isC(int x,int y){
	if(x>=5){
		return 0;
	}
	else if(board[y][x] == '1' && board[y][x+1] == '1' &&
		board[y][x+2] == '1' && board[y][x+3] == '1'){
			return 1;
	}
	else{
		return 0;
	}
}
int isD(int x,int y){
	if(x==0 || y >= 6){
		return 0;
	}
	else if(board[y][x] == '1' && board[y][x+1]=='1' &&
		board[y-1][x+1] == '1' && board[y-1][x+2] == '1'){
			return 1;
	}
	else{
		return 0;
	}
}

int isE(int x,int y){
	if(x>=6 || y>=7){
		return 0;
	}
	else if(board[y][x] == '1' && board[y+1][x] == '1' &&
		board[y+1][x+1] == '1' && board[y+2][x+1] == '1'){
			return 1;
	}
	else {
		return 0;
	}
}
int isF(int x,int y){
	if(x>=7 || y>=6 ){
		return 0;
	}
	else if(board[y][x] == '1' && board[y][x+1] == '1' &&
		board[y+1][x+1] == '1' && board[y+1][x+2] == '1'){
			return 1;
	}
	else{
		return 0;
	}
}

int isG(int x,int y){
	if(x>=6 ||y==0){
		return 0;
	}
	else if(board[y][x] == '1' && board[y+1][x] == '1'&&
		board[y+1][x-1] == '1' && board[y+2][x-1]=='1'){
			return 1;
	}
	else{
		return 0;
	}
}

int main(){


	while(cin>>board[0]){
		for(int i=1;i<8;i++){
			cin>>board[i];
		}

		for(int i=0;i<8;i++){
			for(int j=0;j<8;j++){
				if(board[j][i] == '1'){
					if(isA(i,j)){
						cout<<"A"<<endl;
					}
					else if(isB(i,j)){
						cout<<"B"<<endl;
					}
					else if(isC(i,j)){
						cout<<"C"<<endl;
					}
					else if(isD(i,j)){
						cout<<"D"<<endl;
					}
					else if(isE(i,j)){
						cout<<"E"<<endl;
					}
					else if(isF(i,j)){
						cout<<"F"<<endl;
					}
					else if(isA(i,j)){
						cout<<"G"<<endl;
					}
				}
			}
			if(!(cin>>board[0])){
				break;
			}
		}
	}
	return 0;
}
					