using System;
using System.Collections.Generic;
using System.Linq;

namespace AOJ
{
  class Problem0036
  {
    public static void Main(string[] args)
    {
      foreach (var field in Read())
      {
        int origX = 0, origY = 0;
        var origFound = false;
        foreach (var row in Enumerable.Range(0, 8))
        {
          foreach (var col in Enumerable.Range(0, 8))
          {
            if (field[row][col])
            {
              origX = col;
              origY = row;
              origFound = true;
              break;
            }
          }
          if (origFound)
            break;
        }
        // check for A
        if (origY <= 6 && origX <= 6 && field[origY][origX + 1] && field[origY + 1][origX] && field[origY + 1][origX + 1])
        {
          Console.WriteLine("A");
          continue;
        }

        // check for B
        if (origY <= 4 && field[origY + 1][origX] && field[origY + 2][origX] && field[origY + 3][origX])
        {
          Console.WriteLine("B");
          continue;
        }

        // check for C
        if (origX <= 4 && field[origY][origX + 1] && field[origY][origX + 2] && field[origY][origX + 3])
        {
          Console.WriteLine("C");
          continue;
        }

        // check for D
        if (0 < origX && origY <= 5 && field[origY + 1][origX - 1] && field[origY + 1][origX] && field[origY + 2][origX - 1])
        {
          Console.WriteLine("D");
          continue;
        }

        // check for E
        if (origX <= 5 && origY <= 6 && field[origY][origX + 1] && field[origY + 1][origX + 1] && field[origY + 1][origX + 2])
        {
          Console.WriteLine("E");
          continue;
        }

        // check for F
        if (origX <= 6 && origY <= 5 && field[origY + 1][origX] && field[origY + 1][origX + 1] && field[origY + 2][origX + 1])
        {
          Console.WriteLine("F");
          continue;
        }

        // check for G
        if (0 < origX && origX < 7 && origY <= 6 && field[origY][origX + 1] && field[origY + 1][origX] && field[origY + 1][origX - 1])
        {
          Console.WriteLine("G");
          continue;
        }
      }
    }

    public static IEnumerable<bool[][]> Read()
    {
      foreach (var t in ReadLine().Slice(8))
        yield return t;
    }

    public static IEnumerable<bool[]> ReadLine()
    {
      string line;
      while ((line = Console.ReadLine()) != null)
      {
        if (line == "")
          continue;
        yield return line.Select(c => c == '0' ? false : true).ToArray();
      }
    }
  }

  static class EnumerableEx
  {
    public static IEnumerable<T[]> Slice<T>(this IEnumerable<T> source, int count)
    {
      return Slice<T, T[]>(source, count, x => x.ToArray());
    }

    public static IEnumerable<TResult> Slice<TSource, TResult>(this IEnumerable<TSource> source, int count, Func<IEnumerable<TSource>, TResult> selector)
    {
      var result = new List<TSource>(count);
      foreach (var v in source)
      {
        result.Add(v);
        if (result.Count == count)
        {
          yield return selector(result);
          result.Clear();
        }
      }
      if (result.Any())
        yield return selector(result);
    }
  }
}

Measured memory_bytes: 5760