#include<iostream>
using namespace std;

int main() {
	char c[8][8];
	while (cin >> c[0]) {
		for (int i = 1;i < 8;i++)cin >> c[i];

		int ax, ay;
		for (int i = 0;i < 8;i++) {
			for (int j = 0;j < 8;j++) {
				if (c[i][j] == '1') {
					ax = i;
					ay = j;
					goto floop;
				}
			}
		}
	floop:
		if (c[ax][ay] == c[ax][ay + 1]) {
			if (c[ax][ay] == c[ax + 1][ay] && c[ax + 1][ay] == c[ax + 1][ay])cout << 'A' << endl;
			else if (c[ax][ay] == c[ax][ay + 2] && c[ax][ay ] == c[ax][ay + 3])cout << 'C' << endl;
			else if (c[ax][ay] == c[ax + 1][ay + 1] && c[ax][ay] == c[ax + 1][ay + 2])cout << 'E' << endl;
			else cout << 'G' << endl;
		}
		if (c[ax][ay] == c[ax + 1][ay]) {
			if (ax<5&&c[ax][ay] == c[ax + 2][ay] && c[ax][ay] == c[ax + 3][ay])cout << 'B' << endl;
			else if (c[ax][ay] == c[ax + 1][ay + 1] && c[ax][ay] == c[ax + 2][ay + 1])cout << 'F' << endl;
			else if(c[ax+1][ay+1]=='0')cout << 'D' << endl;
		}
	}
	return 0;
}