#include <iostream>
#include <vector>
#include <list>
#include <algorithm>
#include <string>
#include <stack>
#include <iomanip>
#include <numeric>
#include <queue>
#include <climits>
#include <complex>
#include <cmath>
#include <map>
using namespace std;
using ll = long long;
#define MOD 1000000007
#define INF 1LL << 59

bool operator<(const pair<int, int> &a, const pair<int, int> &b)
{
    if (a.first == b.first)
        a.second < b.second;
    a.first < b.first;
}
vector<string> v;

vector<pair<int, int>> vp;
int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    //cout << fixed << setprecision(3);
    while (1)
    {
        bool eo = false;
        for (int i = 0; i < 8; ++i)
        {
            string s = "";
            cin >> s;
            if (s == "")
            {
                eo = true;
                break;
            }
            s = "0000" + s;
            s += "0000";
            v.push_back(s);
        }
        if (eo)
            break;
        v.push_back("0000000000000000");
        v.push_back("0000000000000000");
        v.push_back("0000000000000000");

        string ans = "";
        for (int i = 0; i < v.size(); ++i)
        {
            for (int j = 0; j < v[i].size(); ++j)
            {
                if (v[i][j] == '1')
                {
                    if (v[i][j + 1] == '1' && v[i + 1][j] == '1' && v[i + 1][j + 1] == '1')
                    {
                        ans = "A";
                    }
                    else if (v[i + 1][j] == '1' && v[i + 2][j] == '1' && v[i + 3][j] == '1')
                    {
                        ans = "B";
                    }
                    else if (v[i][j + 1] == '1' && v[i][j + 2] == '1' && v[i][j + 3] == '1')
                    {
                        ans = "C";
                    }
                    else if (v[i + 1][j] == '1' && v[i + 1][j - 1] == '1' && v[i + 2][j - 1] == '1')
                    {
                        ans = "D";
                    }
                    else if (v[i][j + 1] == '1' && v[i + 1][j + 1] == '1' && v[i + 1][j + 2] == '1')
                    {
                        ans = "E";
                    }
                    else if (v[i + 1][j] == '1' && v[i + 1][j + 1] == '1' && v[i + 2][j + 1] == '1')
                    {
                        ans = "F";
                    }
                    else if (v[i + 1][j] == '1' && v[i][j + 1] == '1' && v[i + 1][j - 1] == '1')
                    {
                        ans = "G";
                    }
                }
            }
        }
        cout << ans << endl;
    }
    return 0;
}
