#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;

//// < "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\b.txt"

map<set<pair<int, int>>, int>mp;

int main() {
	mp[set<pair<int, int>>{make_pair(0, 0), make_pair(0, 1), make_pair(0, 2), make_pair(0, 3)}] = 1;
	mp[set<pair<int, int>>{make_pair(0, 0), make_pair(0, 1), make_pair(1, 1), make_pair(1, 0)}] = 0;
	mp[set<pair<int, int>>{make_pair(0, 0), make_pair(1, 0), make_pair(2, 0), make_pair(3, 0)}] = 2;
	mp[set<pair<int, int>>{make_pair(0, 1), make_pair(1, 0), make_pair(0, 2), make_pair(1, 1)}] = 3;
	mp[set<pair<int, int>>{make_pair(0, 0), make_pair(1, 0), make_pair(2,1), make_pair(1, 1)}] = 4;
	mp[set<pair<int, int>>{make_pair(0, 0), make_pair(0, 1), make_pair(1, 1), make_pair(1, 2)}] = 5;
	mp[set<pair<int, int>>{make_pair(1, 0), make_pair(0, 1), make_pair(1, 1), make_pair(2, 0)}] = 6;
	vector<string>sts(8);
	while (cin >> sts[0]) {
		for (int i = 1; i < 8; ++i)cin >> sts[i];
		int minx = 10;
		int miny = 10;
		
		for (int i = 0; i < 8; ++i) {
			for (int j = 0; j < 8; ++j) {
				if (sts[i][j] == '1') {
					minx = min(minx, j);
					miny = min(miny, i);
				}
			}
		}
		set<pair<int, int>>ps;
		for (int i = 0; i < 8; ++i) {
			for (int j = 0; j < 8; ++j) {
				if (sts[i][j] == '1') {
					ps.emplace(j - minx, i - miny);
				}
			}
		}
		if (mp.find(ps) == mp.end())assert(false);
		cout <<char( 'A' + mp[ps]) << endl;
	}
	return 0;
}