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

void Figure(int str[8][8]){
  int i, k;

  for(i = 0;i < 8;i++){
    for(k = 0;k < 8;k++){
      if(str[i][k] == 1){ //1???????????????
	if(str[i][k + 1] == 1){ //?????¢???A,C,E,G?????????
	  if(str[i][k + 2] == 1){ //???????????°C
	    cout << "C" << endl;
	  }else{ //?????????A,E,G
	    if(str[i + 1][k + 1] == 0){ //???????????°G
	      cout << "G" << endl;
	    }else{ // ?????????A,E
	      if(str[i + 1][k] == 1){ //???????????°A
		cout << "A" << endl; //?????????E
	      }else{
		cout << "E" << endl;
	      }
	    }
	  }
	}else{ //?¬?????????¢B,D,F?????¢???
	  if(str[i + 2][k] == 1){ //???????????°B
	    cout << "B" << endl;
	  }else{ //?????????D,F
	    if(str[i + 1][k + 1] == 1){ //???????????°F
	      cout << "F" << endl;
	    }else{ //?????????D
	      cout << "D" << endl;
	    }
	  }
	}
      }
    }
  }
}


int main(){
  int str[8][8], i, k;

  while(scanf("%d", &str[0][0]) != EOF){
    for(i = 0;i < 8;i++){
      for(k = 0;k < 8;k++){
	if(i != 0 && k != 0){
	  cin >> str[i][k];
	}
      }
    }
    Figure(str);
  }

  return 0;
}