#include<iostream>

using namespace std;

int main()
{
	int i,j;
	char map[10][10];
	
	for(;cin >> map[0][0];)
	{
		int sx,sy,flag=0;;
		
		for(i=0;i<8;i++)
		{
			for(j=0;j<8;j++)
			{
				if(i==0 && j==0)
					j++;
				cin >> map[i][j];
				
				
				if(map[i][j]=='1' && flag==0)
				{
					sy=i;
					sx=j;
					flag=1;
				}
			}
		}
		
		if(map[sy][sx+1]=='1')
		{
			if(map[sy+1][sx]=='1')
			{
				if(map[sy+1][sx+1]=='1')
					cout << "A" << endl;
				else
					cout << "G" << endl;
			}
			else
			{
				if(map[sy][sx+2]=='1')
					cout << "C" << endl;
				else
					cout << "E" << endl;
			}
		}
		else
		{
			if(map[sy+2][sx]=='1')
				cout << "B" << endl;
			else
			{
				if(map[sy+1][sx+1]=='1')
					cout << "F" << endl;
				else
					cout << "D" << endl;
			}
		}
	}
}