#include <bits/stdc++.h>

using namespace std;

int main() {

    string s = "";
    string graph[7] =
    {
        "1100110000000000",
        "1000100010001000",
        "1111000000000000",
        "0100110010000000",
        "1100011000000000",
        "1000110001000000",
        "0110110000000000"
    };

    int find = 0;
    char field[8][9];

    for(int i = 0; i < 8; ++i) {
        cin >> field[i];
    }

    for(int i = 0; i < 8 && find == 0; ++i) {
        for(int j = 0; j < 6 && find == 0; ++j) {
            if(field[i][j] == '1' || field[i][j + 1] == '1' && field[i - 1][j] == '1') {
                find = 1;
                for(int k = i; k < i + 4; ++k) {
                    for(int l = j; l < j + 4; ++l) {
                        s += field[k][l];
                    }
                }
            }
        }
    }

    for(int i = 0; i < 7; ++i) {
        if(s == graph[i]) {
            cout << (char)('A' + i) << endl;
            break;
        }
    }

}