#include<cstdio>
#include<iostream>
using namespace std;

int main(){

  char str[11][11];

  while( scanf("%s",str[0]) != EOF){
    
    int x=-1,y=-1;

    for(int j=0;j<8;j++){
      if(str[0][j]=='1'){
	x=j;
	y=0;
	break;
      }
    }
    
    for(int i=1;i<8;i++){
      scanf("%s",str[i]);
      if(x==-1 && y==-1){
	for(int j=0;j<8;j++){
	  if(str[i][j]=='1'){
	    x=j;
	    y=i;
	    break;
	  }
	}
      }
    }
    
    if(str[y][x+1]=='1' && str[y+1][x]=='1' && str[y+1][x+1]=='1') printf("A\n");
    else if(str[y+1][x]=='1' && str[y+2][x]=='1' && str[y+3][x]=='1') printf("B\n");
    else if(str[y][x+1]=='1' && str[y][x+2]=='1' && str[y][x+3]=='1') printf("C\n");
    else if(str[y+1][x]=='1' && str[y+1][x-1]=='1' && str[y+2][x-1]=='1') printf("D\n");
    else if(str[y][x+1]=='1' && str[y+1][x+1]=='1' && str[y+1][x+2]=='1') printf("E\n");
    else if(str[y][x+1]=='1' && str[y+1][x]=='1' && str[y+1][x-1]=='1') printf("F\n");
    else printf("G\n");
    
  }
  return 0;
    
}