#include <iostream>

using namespace std;

int main(void){
     char field[8][8];
     char tmp;
     int i,j;
    
     for(i=0;i<8;i++){
          for(j=0;j<8;j++){
               cin >> field[i][j];
          }
     }

     //»ê¼êÌ`ÉÂ¢Ä»Ê
     //Ü¸¶ãÌ}XðT·
     for(i=0;i<8;i++){
          for(j=0;j<8;j++){
               if(field[i][j]) goto NEXT;
          }
     }
    
     NEXT:
     if(field[i][j+1] && field[i][j+2] && field[i][j+3]){
          //¡êñ
	   cout << "C" << endl;
     }else if(field[i+1][j] && field[i+2][j] && field[i+3][j]){
          //cêñ
	   cout << "B" << endl;
     }else if(field[i][j+1] && field[i+1][j] && field[i+1][j+1]){
          //³û`
	   cout << "A" << endl;
     }else if(field[i+1][j] && field[i+1][j+1] && field[i+2][j+1]){
          //1 0
          //1 1
          //0 1
	   cout << "F" << endl;
     }else if(field[i][j+1] && field[i+1][j] && field[i+1][j-1]){
          //0 1 1
          //1 1 0
	   cout << "G" << endl;
     }else if(field[i][j+1] && field[i+1][j+1] && field[i+1][j+2]){
          //1 1 0
          //0 1 1
          cout << "E" << endl;
     }else{
	   cout << "D" << endl;
     }
     return 0;
}