//0036
#include<iostream>
using namespace std;

struct ca {
	int x;
	int y;
};

int main() {
	ca l[4];
	char c;
	while (cin >> c){
		int a = 0;
		if (c=='1'){
			l[a].x = 0;
			l[a].y = 0;
		}
		for (int i = 0; i < 8; i++) {
			for (int j = 1; j < 8; j++) {
				cin >> c;
				if (c == '1')
				{
					l[a].x = i;
					l[a].y = j;
					a++;
				}
			}
		}
		int x = l[0].x;
		int y = l[0].y;
		if (l[1].x == x&&l[1].y == y + 1) {
			//[l0][l1]
			//ACEG
			if (l[3].x == x + 1 && l[3].y == y + 1)
				cout << 'A';
			else if (l[3].y == y + 3)
				cout << 'C';
			else if (l[3].x == x + 1 && l[3].y == y + 2)
				cout << 'E';
			else cout << 'G';
		}
		else if (l[1].x == x + 1 && l[1].y == y) {
			/*[l0]
			  [l1]*/
			  //BF
			if (l[3].x == x + 3 && l[3].y == y)
				cout << 'B';
			else cout << 'F';
		}
		else cout << 'D';
		cout << endl;
	}
	cin >> c;
	return 0;
}