#include <iostream>
using namespace std;

char whatFigure(int x, int y, char field[][9]) {
    int sum = 0;
    sum += field[y][x + 1] - '0';
    sum += (field[y + 1][x + 1] - '0') << 1;
    sum += (field[y + 1][x] - '0') << 2;
    if (x > 0) {
        sum += (field[y + 1][x - 1] - '0') << 3;
    }
    switch (sum) {
    case 7:
        return 'A';
        break;
    case 4:
        return 'B';
        break;
    case 1:
        return 'C';
        break;
    case 12:
        return 'D';
        break;
    case 3:
        return 'E';
        break;
    case 6:
        return 'F';
        break;
    case 13:
        return 'G';
        break;
    default:
        return '0';
        break;
    }
}

int main() {
    char field[8][9] = {};
start:
    while (cin >> field[0]) {
        for (int i = 1; i < 8; i++) {
            cin >> field[i];
        }
        for (int y = 0; y < 8; y++) {
            for (int x = 0; x < 8; x++) {
                if (field[y][x] == '1') {
                    cout << whatFigure(x, y, field) << endl;
                    goto start;
                }
            }
        }
    }
}