#include <stdio.h>
int main() {
    int RB[8][8],i,j;while (scanf("%1d",&RB[0][0])!=EOF) {for (i=1;i<8;scanf("%1d",&RB[0][i++]));for (i=1;i<8;i++) for (j=0;j<8;scanf("%1d",&RB[i][j++]));
        for (i=0;i<8;i++) for (j=0;j<8;j++) if (RB[i][j]) {if (j<=4 && RB[i][j+1]*RB[i][j+2]*RB[i][j+3]) puts("C"); else if (i<=4 && RB[i+1][j]*RB[i+2][j]*RB[i+3][j]) puts("B"); else if (i<7 && j<7) {
            if (RB[i+1][j]*RB[i][j+1]) puts("A"); else if (RB[i+2][j+1]) puts("F"); else puts("E");} else if (j<7 && RB[i][j+1]) puts("G"); else puts("D"); i=10,j=10;}}return 0;}