#include <iostream>
#include <vector>
#include <cstdio>
using namespace std;

struct Point{
public:
	int x,y;
	Point(int _x, int _y){x=_x;y=_y;}
	void show(){cout<<x<<","<<y<<endl;}
	bool eq(Point &a){return x==a.x && y==a.y;}
};

bool eqFig(vector<Point> &a, vector<Point> &b){
	if(a.size()!=b.size()){
		return false;
	}else{
		vector<Point>::iterator ita=a.begin(), itb=b.begin();
		for(;ita<a.end();++ita,++itb){
			if(!(ita->eq(*itb))){
				return false;
			}
		}
		return true;
	}
}

int main() {
	Point fig_a[4] = {Point(0,0),Point(1,0),Point(0,1),Point(1,1)};
	Point fig_b[4] = {Point(0,0),Point(0,1),Point(0,2),Point(0,3)};
	Point fig_c[4] = {Point(0,0),Point(1,0),Point(2,0),Point(3,0)};
	Point fig_d[4] = {Point(0,0),Point(-1,1),Point(0,1),Point(-1,2)};
	Point fig_e[4] = {Point(0,0),Point(1,0),Point(1,1),Point(2,1)};
	Point fig_f[4] = {Point(0,0),Point(0,1),Point(1,1),Point(1,2)};
	Point fig_g[4] = {Point(0,0),Point(1,0),Point(-1,1),Point(0,1)};
	vector<Point> _figs[7] = {vector<Point>(fig_a,fig_a+4),
		vector<Point>(fig_b,fig_b+4),
		vector<Point>(fig_c,fig_c+4),
		vector<Point>(fig_d,fig_d+4),
		vector<Point>(fig_e,fig_e+4),
		vector<Point>(fig_f,fig_f+4),
		vector<Point>(fig_g,fig_g+4)
	};
	vector< vector<Point> > figs(_figs,_figs+7);
	vector<Point>fig;
	unsigned char ch;
	
	do{
		fig.clear();
		int x=0,y=0,sx;
		bool flg=false;
		
		for(int i=0;i<8;++i){
			for(int j=0;j<8;++j){
				ch = getchar();
				if(ch == '1'){
					fig.push_back(Point(x,y));
					if(!flg)sx = j;
					flg = true;
				}
				if(flg){
					x = 1 + j - sx;
				}
			}
			if(flg)++y;
			getchar();
		}
		
		for(int i=0;i<7;++i){
			if(eqFig(figs[i],fig)){
				cout<<(char)('A'+i)<<endl;
				break;
			}
		}
		
	}while(getchar()!=EOF);
	return 0;
}