#include <iostream>
#include <cmath>
using namespace std;
int a[15][15]={};
int main ()
{
	while(cin>>a[0][0])
	{
		for(int x=0;x<8;x++)
		{
			for(int y=0;y<8;y++)
			{
				if(x==0&&y==0)continue;
				cin>>a[x][y];
			}
		}
		
		for(int x=0;x<8;x++)
		{
			for(int y=0;y<8;y++)
			{
				if(a[x][y]&&a[x+1][y]&&a[x][y+1]&&a[x+1][y+1])
				{
					cout<<"A"<<endl;
				}
				else if(a[x][y]&&a[x][y+1]&&a[x][y+2]&&a[x][y+3])
				{
					cout<<"B"<<endl;
				}
				else if(a[x][y]&&a[x+1][y]&&a[x+2][y]&&a[x+3][y])
				{
					cout<<"C"<<endl;
				}
				else if(a[x+1][y]&&a[x][y+1]&&a[x+1][y+1]&&a[x][y+2])
				{
					cout<<"D"<<endl;
				}
				else if(a[x][y]&&a[x+1][y]&&a[x+1][y+1]&&a[x+2][y+1])
				{
					cout<<"E"<<endl;
				}
				else if(a[x][y]&&a[x][y+1]&&a[x+1][y+1]&&a[x+1][y+2])
				{
					cout<<"F"<<endl;
				}
				else if(a[x+1][y]&&a[x+2][y]&&a[x][y+1]&&a[x+1][y+1])
				{
					cout<<"G"<<endl;
				}
			}
		}
	}
}