using System;
using System.Linq;

namespace _036_AFigureonSurface
{
	class Program
	{
		static void Main ( string[] args )
		{
			string[] inputStr = new string[8];

			do
			{
				for (int lp = 0; lp < inputStr.Length; lp++)
				{
					inputStr[lp] = Console.ReadLine ();
				}

				char result = Judge.Figure (inputStr);
				Console.WriteLine (result);

			} while ((inputStr[0] = Console.ReadLine ()) != null);
		}
	}

	static class Judge
	{
		public static char Figure ( string[] map )
		{
			//??¢?´¢?????????????????????1?????????????????´????????¢???
			int rowIndex = 0;
			int colIndex = 0;

			bool isExist = false;
			for (int row = 0; row < map.Length; row++)
			{
				for (int col = 0; col < map[row].Length; col++)
				{
					if (map[row][col] == '1')
					{
						rowIndex = row;
						colIndex = col;
						isExist = true;
						break;
					}
				}

				if (isExist)
				{
					break;
				}
			}

			//if?????§??????????????¢???
			if (FigureA (map, rowIndex, colIndex) == 'A')
			{
				return 'A';
			}
			else if (FigureB (map, rowIndex, colIndex) == 'B')
			{
				return 'B';
			}
			else if (FigureC (map, rowIndex, colIndex) == 'C')
			{
				return 'C';
			}
			else if (FigureD (map, rowIndex, colIndex) == 'D')
			{
				return 'D';
			}
			else if (FigureE (map, rowIndex, colIndex) == 'E')
			{
				return 'E';
			}
			else if (FigureF (map, rowIndex, colIndex) == 'F')
			{
				return 'F';
			}
			else
			{
				return 'G';
			}
		}

		private static char FigureA ( string[] map, int row, int col )
		{
			if (row + 1 < map.Length && col + 1 < map[0].Length)
			{
				bool[] isExist = new bool[4];

				isExist[0] = map[row][col] == '1';
				isExist[1] = map[row + 1][col] == '1';
				isExist[2] = map[row][col + 1] == '1';
				isExist[3] = map[row + 1][col + 1] == '1';

				if (isExist.All (item => item == true))
				{
					return 'A';
				}
			}

			return 'Z';
		}
		private static char FigureB ( string[] map, int row, int col )
		{
			if (row + 3 < map.Length)
			{
				bool[] isExist = new bool[4];

				isExist[0] = map[row][col] == '1';
				isExist[1] = map[row + 1][col] == '1';
				isExist[2] = map[row + 2][col] == '1';
				isExist[3] = map[row + 3][col] == '1';

				if (isExist.All (item => item == true))
				{
					return 'B';
				}
			}

			return 'Z';
		}
		private static char FigureC ( string[] map, int row, int col )
		{
			if (col + 3 < map[0].Length)
			{
				bool[] isExist = new bool[4];

				isExist[0] = map[row][col] == '1';
				isExist[1] = map[row][col + 1] == '1';
				isExist[2] = map[row][col + 2] == '1';
				isExist[3] = map[row][col + 3] == '1';

				if (isExist.All (item => item == true))
				{
					return 'C';
				}
			}

			return 'Z';
		}
		private static char FigureD ( string[] map, int row, int col )
		{
			if (row + 2 < map.Length && 0 <= col - 1)
			{
				bool[] isExist = new bool[4];

				isExist[0] = map[row][col] == '1';
				isExist[1] = map[row + 1][col - 1] == '1';
				isExist[2] = map[row + 1][col] == '1';
				isExist[3] = map[row + 2][col - 1] == '1';

				if (isExist.All (item => item == true))
				{
					return 'D';
				}
			}

			return 'Z';
		}
		private static char FigureE ( string[] map, int row, int col )
		{
			if (row + 1 < map.Length && col + 2 < map[0].Length)
			{
				bool[] isExist = new bool[4];

				isExist[0] = map[row][col] == '1';
				isExist[1] = map[row][col + 1] == '1';
				isExist[2] = map[row + 1][col + 1] == '1';
				isExist[3] = map[row + 1][col + 2] == '1';

				if (isExist.All (item => item == true))
				{
					return 'E';
				}
			}

			return 'Z';
		}
		private static char FigureF ( string[] map, int row, int col )
		{
			if (row + 2 < map.Length && col + 1 < map[0].Length)
			{
				bool[] isExist = new bool[4];

				isExist[0] = map[row][col] == '1';
				isExist[1] = map[row + 1][col] == '1';
				isExist[2] = map[row + 1][col + 1] == '1';
				isExist[3] = map[row + 2][col + 1] == '1';

				if (isExist.All (item => item == true))
				{
					return 'F';
				}
			}

			return 'Z';
		}
		private static char FigureG ( string[] map, int row, int col )
		{
			if (row + 1 < map.Length && 0 <= col - 1 && col + 1 < map[0].Length)
			{
				bool[] isExist = new bool[4];

				isExist[0] = map[row][col] == '1';
				isExist[1] = map[row][col + 1] == '1';
				isExist[2] = map[row + 1][col] == '1';
				isExist[3] = map[row + 1][col - 1] == '1';

				if (isExist.All (item => item == true))
				{
					return 'G';
				}
			}

			return 'Z';
		}
	}
}

Measured memory_bytes: 9108