#include <iostream>
#include <string>
using namespace std;

#define SIZE 8

int main() {
	string source[SIZE];
	while (!cin.eof()) {
		for (int i = 0; i < SIZE; i++) {
			cin >> source[i];
		}

		int map[14][14], x = SIZE, y = SIZE;
		for (int i = 0; i < SIZE; i++) {
			for (int j = 0; j < SIZE; j++) {
				map[i + 3][j + 3] = source[i][j] == '1' ? 1 : 0;
				if (source[i][j] == '1' && j < x && i < y) {
					x = j;
					y = i;
				}
			}
		}
		x += 3;
		y += 3;

		if (map[y + 1][x + 1] == 1) {
			if (map[y][x + 1] == 1 && map[y + 1][x] == 1) {
				cout << "A";
			} else if (map[y + 2][x + 1] == 1 && map[y + 1][x] == 1) {
				cout << "F";
			} else if (map[y + 1][x + 2] == 1 && map[y][x + 1] == 1) {
				cout << "E";
			}
		} else if (map[y - 1][x - 1] == 1) {
			if (map[y][x + 1] == 1 && map[y + 1][x] == 1) {
				cout << "G";
			} else if (map[y + 2][x - 1] == 1 && map[y + 1][x] == 1) {
				cout << "D";
			}
		} else if (map[y + 1][x] == 1 && map[y + 2][x] == 1 && map[y + 3][x] == 1) {
			cout << "B";
		} else if (map[y][x + 1] == 1 && map[y][x + 2] == 1 && map[y][x + 3] == 1) {
			cout << "C";
		}
		cout << endl;
	}
	return 0;
}