#include <iostream>

using namespace std;

int main()
{
	char field[8][8];
	char tmp;
	int i,j;
	while(1){
		for(i=0;i<8;i++){
			for(j=0;j<8;j++){
				cin >> field[i][j];
			}
		}
		for(i=0;i<8;i++){
			for(j=0;j<8;j++){
				if(field[i][j]=='1')goto NEXT;
			}
		}
		NEXT:
			//横一列
			if(j+3<=7&&field[i][j+1]=='1'&&field[i][j+2]=='1'&&field[i][j+3]=='1')
				cout<<"C"<<endl;
			//縦一列
			else if(i+3<=7&&field[i+1][j]=='1'&&field[i+2][j]=='1'&&field[i+3][j]=='1')
				cout<<"B"<<endl;
			//正方形
			else if(j+1<=7&&i+1<=7&&field[i][j+1]=='1'&&field[i+1][j]=='1'&&field[i+1][j+1]=='1')
				cout<<"A"<<endl;
			/*1 0
				1 1
				0 1*/
			else if(i+2<=7&&j+1<=7&&field[i+1][j]=='1'&& field[i+1][j+1]=='1'&&field[i+2][j+1]=='1')
				cout<<"F"<<endl;
			/*0 1 1
				1 1 0*/
			else if(j-1>=0&&j+1<=7&&i+1<= 7&&field[i][j+1]=='1'&&field[i+1][j]=='1'&&field[i+1][j-1]=='1')
				cout<<"G"<<endl;
			/*1 1 0
				0 1 1*/
			else if(j+2<=7&&i+1<=7&&field[i][j+1]=='1'&&field[i+1][j+1]=='1'&&field[i+1][j+2]=='1')
				cout<<"E"<<endl;
			else cout<<"D"<<endl;
			cin.clear();
			cin.ignore();
			if(cin.eof())return 0;
		}
	return 0;
}