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

vector<string> field(11);

int main() {
    string s;
    while (cin >> s) {
        field[0] = "000" + s + "000";
        for (int i = 1; i < 8; i++) {
            cin >> s;
            field[i] = "000" + s + "000";
        }
        for (int i = 8; i < 11; i++) {
            field[i] = "00000000000000";
        }
        int x, y;
        for (int i = 0; i < 8; i++) {
            for (int j = 3; j < 11; j++) {
                if (field[i][j] == '1') {
                    y = i, x = j;
                    goto end;
                }
            }
//            cout << endl;
        } 
end:

//        for (int i = 0; i < 8; i++) {
//            for (int j = 3; j < 11; j++) {
//                cout << field[i][j] << ' ';
//            }
//            cout << endl;
//        }

        char ans;
//        cout << x << ' ' << y << endl;
        if (field[y][x+1] == '1') {
            if (field[y][x+3] == '1') ans = 'C';
            else if (field[y+1][x-1] == '1') ans = 'G';
            else if (field[y+1][x+2] == '1') ans = 'E';
            else if (field[y+1][x] == '1') ans = 'A';
        } else {
            if (field[y+3][x] == '1') ans = 'B';
            else if (field[y+1][x-1] == '1') ans = 'D';
            else ans = 'F';
        }
        cout << ans << endl;
    }
    return 0;
}