#include <bits/stdc++.h>
using namespace std;

int main() {
  string str[8];
  while(1) {
    for ( int i = 0; i < 8; i++ ) cin >> str[i];
    if ( cin.eof() ) return 0;
    char ans;
    for ( int i = 0; i < 8; i++ ) {
      for ( int j = 0; j < 8; j++ ) {
      if ( str[i][j] == '1' && str[i][j+1] == '1' && 
	   str[i+1][j] == '1' && str[i+1][j+1] == '1' ) ans = 'A';
      else if ( str[i][j] == '1' && str[i+1][j] == '1' &&
		str[i+2][j] == '1' && str[i+3][j] =='1' ) ans = 'B';
      else if ( str[i][j] == '1' && str[i][j+1] == '1' &&
		str[i][j+2] == '1' && str[i][j+3] == '1' ) ans = 'C';
      else if ( str[i][j] == '1' && str[i+1][j-1] == '1' &&
		str[i+1][j] == '1' && str[i+2][j-1] == '1' ) ans = 'D';
      else if ( str[i][j] == '1' && str[i][j+1] == '1' &&
		str[i+1][j+1] == '1' && str[i+1][j+2] == '1' ) ans = 'E';
      else if ( str[i][j] == '1' && str[i+1][j] == '1' &&
		str[i+1][j+1] == '1' && str[i+2][j+1] == '1' ) ans = 'F';
      else if ( str[i][j] == '1' && str[i][j+1] == '1' &&
		str[i+1][j-1] == '1' && str[i+1][j] == '1' ) ans = 'G';
							 
      }
    }
    cout << ans << endl;
  }
  return 0;
}