#include <stdio.h>

#define N 8

#define DEBUG 0
#define debug if(DEBUG)

int main(void){
	int fld[N][N];
	int isEOF;
	char buf[N+1];
	int top, btm, lft, rit;
	
	while (1){
		for (int i=0; i<N; i++){
			isEOF = (scanf("%s", buf) == EOF);
			for (int j=0; j<N; j++){
				fld[j][i] = buf[j] - '0';
			}
		}
		if (isEOF) break;
		debug{
			puts("+--------+");
			for (int i=0; i<N; i++){
				printf("|");
				for (int j=0; j<N; j++){
					printf("%c", fld[j][i]?'@':'.');
				}
				printf("|\n");
			}
			puts("+--------+");
		}
		// check boundary
		top = -1;
		for (int i=0; i<N; i++){
			for (int j=0; j<N; j++){
				if (fld[j][i]) top = i;
			}
			if (top != -1) break;
		}
		btm = -1;
		for (int i=N-1; i>=0; i--){
			for (int j=0; j<N; j++){
				if (fld[j][i]) btm = i;
			}
			if (btm != -1) break;
		}
		lft = -1;
		for (int i=0; i<N; i++){
			for (int j=0; j<N; j++){
				if (fld[i][j]) lft = i;
			}
			if (lft != -1) break;
		}
		rit = -1;
		for (int i=N-1; i>=0; i--){
			for (int j=0; j<N; j++){
				if (fld[i][j]) rit = i;
			}
			if (rit != -1) break;
		}
		debug printf("bound: (%d,%d)-(%d,%d)\n", lft, top, rit, btm);
		// check shape ptn
		if (top == btm) puts("C");
		else if (lft == rit) puts("B");
		else if (btm - top == rit - lft == 1) puts("A");
		else if (btm - top > rit - lft) puts(fld[lft][top]?"D":"F");
		else puts(fld[lft][top]?"E":"G");
		
	}
	// 
	return 0;
}