#include <iostream>
using namespace std;

char ch[8][8]={};
bool check(int x, int y){
  return (0<=x && x<8 && 0<=y && y<8)&&(ch[x][y]=='1');
}

int main() {
  while(cin >> ch[0][0]) {
    for(int i=1; i<8; i++) cin >> ch[0][i];
    for(int i=1; i<8; i++) {
      for(int j=0; j<8; j++) cin >> ch[i][j];
    }
    int x,y;
    for(int i=0; i<8; i++) {
      for(int j=0; j<8; j++) {
	if(ch[i][j]=='1') {
	  x=i;
	  y=j;
	}
      }
    }
    if(check(x-3,y)) cout << "B" << endl;
    else if(check(x,y-3)) cout << "C" << endl;
    else if(check(x-2,y+1)) cout << "D" << endl;
    else if(check(x-1,y-2)) cout << "E" << endl;
    else if(check(x-2,y-1)) cout << "F" << endl;
    else if(check(x,y-1) && check(x-1,y+1)) cout << "G" << endl;
    else cout << "A" << endl;
  }
  return 0;
}
