#define scanf_s scanf
//#define gets_s gets
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MAX 8
#define MIN -100001
#define _MAX 8
int main(void)
{
	char a[MAX][MAX + 1], ans;
	int ki, kj;
	while (1) {
		for (int i = 0; i < MAX; ++i) {
			scanf_s("%s", a[i]);
			for (int j = 0; j < MAX; ++j) {
				if (a[i][j] == '1') {
					ki = i; kj = j;
				}
			}
		}//a,b,d,f,g
		if (ki - 1 >= 0 && a[ki - 1][kj] == '1') {
			if (ki - 2 >= 0 && a[ki - 2][kj] == '1') ans = 'B';
			else {//a,d,f,g
				if (kj - 1 < MAX && a[ki][kj - 1] == '1') {//a,g,
					if (a[ki - 1][kj - 1] == '1') ans = 'A';
					else ans = 'G';
				}
				else {//f,g
					if (kj - 1 < MAX && a[ki - 1][kj - 1] == '1') ans = 'F';
					else ans = 'G';
				}
			}
		}//c,e
		else {
			if (kj - 2 >= 0 && a[ki][kj - 2] == '1') ans = 'C';
			else ans = 'E';
		}
		printf("%c\n", ans);
	}
}