#include <cstdio>
#include <algorithm>
using namespace std;
char imap[8][9];
static pair<int, int> forms[7][3] = {
    {{0, 1}, {1, 0}, {0, -1}},
    {{1, 0}, {1, 0}, {1, 0}},
    {{0, 1}, {0, 1}, {0, 1}},
    {{1, 0}, {0, -1}, {1, 0}},
    {{0, 1}, {1, 0}, {0, 1}},
    {{1, 0}, {0, 1}, {1, 0}},
    {{0, 1}, {1, -1}, {0, -1}}
};
static char decoder[7] = {'A', 'B', 'C', 'D', 'E', 'F', 'G'};
int res;

bool search(int x, int y, int t) {
    bool isFound = true;
    for (int i = 0; i < 3; i++) {
        x += forms[t][i].first, y += forms[t][i].second;
        if (x < 0 || x > 7 || y < 0 || y > 7 || imap[x][y] != '1') { isFound = false; break; }
    }
    return isFound;
}

void solve() {
    bool flag = false;
    res = -1;
    for (int i = 0; i < 8; i++) {
        if (res > -1) break;
        for (int j = 0; j < 8; j++) {
            if (imap[i][j] == '0') continue;
            for (int k = 0; k < 7; k++) {
                if (search(i, j, k)) { res = k; break;}
            }
            break;
        }
    }
}



int main(){

    while(scanf("%s", imap[0]) != EOF) {
        for (int i = 1; i < 8; i++) {
            scanf("%s", imap[i]);
        }
        solve();
        printf("%c\n", decoder[res]);
    }
    return 0;
}

