#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, m, n) for(int i=(m); i<(n); ++i)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define Cout(x) cout << (x) << endl
#define dump(x) cerr << #x << " = " << (x) << endl;
typedef long long LL;
typedef vector<int> VI;
typedef vector<long long> VL;
typedef vector<string> VS;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
const int inf = (int)1e9;
const long long mod = (long long)1e9 + 7;
const double pi = acos(-1.0);

int main() {
	VS s(10);
	while (cin >> s[0]) {
		s[0] += "00000";
		FOR(i, 1, 8) { cin >> s[i]; s[i] += "00000"; }
		s[8] = string(15, '0');
		s[9] = string(15, '0');

		int x = -1, y = -1;
		rep(i, 8)rep(j, 8) {
			if (x == -1 && y == -1 && s[i][j] == '1') { x = j; y = i; break; }
		}

		bool f2 = s[y + 1][x] == '1';
		bool f1 = s[y][x + 1] == '1';
		bool f3 = s[y + 1][x + 1] == '1';

		char ans = '#';
		if (f1 && f2) {//A G
			ans = f3 ? 'A' : 'G';
		}
		else if (f1 && !f2) {//C E
			ans = f3 ? 'E' : 'C';
		}
		else if (!f1 && f2) {//B D F
			if (f3)ans = 'F';
			else ans = s[x][y + 2] == '1' ? 'B' : 'D';
		}
		Cout(ans);
	}
}
