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

int main() {
	char t, c;
	vector<vector<char> > v(8, vector<char>(8, 0));

	while (cin >> c) {
		for (int i = 0; i < 8; i++) {
			for (int j = 0; j < 8; j++) {
				if (i == 0 && j == 0) {
					v.at(0).at(0) = c;
				}
				else {
					cin >> c;
					v.at(i).at(j) = c;
				}
				/*
				cout << v.at(i).at(j);
				if (j == 7) cout << endl;
				if (i == 7 && j == 7) cout << endl;
				*/
			}
		}

		int f = 0;
		int cnt = 0;
		typedef struct point {
			int f, s;
		} Ps;
		Ps a, b;

		for (int i = 0; i < 8; i++) {
			for (int j = 0; j < 8; j++) {
				char ch = v.at(i).at(j);
				if (ch == '1') cnt++;

				if (ch == '1' && cnt == 1) {
					a.f = i;
					a.s = j;
				}
				else if (ch == '1' && cnt == 4) {
					b.f = i;
					b.s = j;
				}

				if (cnt == 4) break;
			}

			if (cnt == 4) break;
		}
		//cout << a.f << ' ' << a.s << endl;
		//cout << b.f << ' ' << b.s << endl;

		if (a.f + 1 == b.f) {
			if (a.s + 1 == b.s) t = 'A';
			if (a.s == b.s) t = 'G';
			if (a.s + 2 == b.s) t = 'E';
		}
		else if (a.f + 2 == b.f) {
			if (a.s - 1 == b.s) t = 'D';
			if (a.s + 1 == b.s) t = 'F';
		}
		else if (a.f == b.f) {
			t = 'C';
		}
		else if (a.f + 3 == b.f) {
			t = 'B';
		}

		cout << t << endl;
	}
}
