using System;

namespace AOJ.Volume0
{
    public class Figure_OnSurface
    {
        private static int[,] map;

        private static bool CheckA(int x, int y)
        {
            if (map[x + 1, y] == 1 && map[x + 1, y + 1] == 1 && map[x, y + 1] == 1) { return true; }
            return false;
        }

        private static bool CheckB(int x, int y)
        {
            if (map[x, y + 1] == 1 && map[x, y + 2] == 1 && map[x, y + 3] == 1) { return true; }
            return false;
        }

        private static bool CheckC(int x, int y)
        {
            if (map[x + 1, y] == 1 && map[x + 2, y] == 1 && map[x + 3, y] == 1) { return true; }
            return false;
        }

        private static bool CheckD(int x, int y)
        {
            if (x == 0) { return false; }
            if (map[x, y + 1] == 1 && map[x - 1, y + 1] == 1 && map[x - 1, y + 2] == 1) { return true; }
            return false;
        }

        private static bool CheckE(int x, int y)
        {
            if (map[x + 1, y] == 1 && map[x + 1, y + 1] == 1 && map[x + 2, y + 1] == 1) { return true; }
            return false;
        }

        private static bool CheckF(int x, int y)
        {
            if (map[x, y + 1] == 1 && map[x + 1, y + 1] == 1 && map[x + 1, y + 2] == 1) { return true; }
            return false;
        }

        public static bool CheckG(int x, int y)
        {
            if (x == 0) { return false; }
            if (map[x + 1, y] == 1 && map[x, y + 1] == 1 && map[x - 1, y + 1] == 1) { return true; }
            return false;
        }

        public static int Main()
        {
            while (true)
            {
                string input = Console.ReadLine();

                map = new int[11, 11];
                // 1行目の処理
                for (int i = 0; i < 8; i++) { map[i, 0] = int.Parse(input.Substring(i, 1)); }
                // 2行目?8行目の読み込み
                for (int i = 1; i < 8; i++)
                {
                    input = Console.ReadLine();
                    for (int j = 0; j < 8; j++) { map[j, i] = int.Parse(input.Substring(j, 1)); }
                }

                bool exit = false;
                for (int y = 0; y < 8; y++)
                {
                    for (int x = 0; x < 8; x++)
                    {
                        if (map[x, y] == 1)
                        {
                            exit = true;
                            string answer = "";
                            // 図形のチェック
                            if (CheckA(x, y)) { answer = "A"; }
                            if (CheckB(x, y)) { answer = "B"; }
                            if (CheckC(x, y)) { answer = "C"; }
                            if (CheckD(x, y)) { answer = "D"; }
                            if (CheckE(x, y)) { answer = "E"; }
                            if (CheckF(x, y)) { answer = "F"; }
                            if (CheckG(x, y)) { answer = "G"; }

                            Console.WriteLine(answer);
                            break;
                        }
                    }
                    if (exit) { break; }
                }

                if (Console.ReadLine() == null) { break; }
            }
            return 0;
        }
    }
}

Measured memory_bytes: 8976