#include <bits/stdc++.h>
using namespace std;

struct Pt { int x, y; };

const int fld = 8;
const vector<vector<Pt>> fig = { // offset
	{ {0,0},{1,0},{-1,1},{1,0} },
	{ {0,0},{0,1},{0,1},{0,1} },
	{ {0,0},{1,0},{1,0},{1,0} },
	{ {0,0},{0,1},{-1,0},{0,1} },
	{ {0,0},{1,0},{0,1},{1,0} },
	{ {0,0},{0,1},{1,0},{0,1} },
	{ {0,0},{1,0},{-2,1},{1,0} }
};

bool match( const vector<string>& a, int x, int y, int fig_i ) {
	for( int i = 0; i < 4; ++i ) {
		x += fig[fig_i][i].x;
		y += fig[fig_i][i].y;

		if( x < 0 || y < 0 || x >= fld || y >= fld || a[y][x] == '0' ) {
			return false;
		}
	}

	return true;
}

int check( const vector<string>& a ) {
	for( int i = 0; i < fld; ++i ) {
		for( int j = 0; j < fld; ++j ) {
			for( int k = 0; k < fig.size(); ++k ) {
				if( match( a, j, i, k ) ) { return k; }
			}
		}
	}

	return -1;
}

int main() {
	ios_base::sync_with_stdio( false );

	vector<string> a;
	string s;
	while( cin >> s ) {
		a.push_back( s );

		if( a.size() == fld ) {
			cout << (char)('A' + check( a )) << '\n';
			a.clear();
		}
	}

	return 0;
}

