#include <iostream>
#include <string>
#include <vector>
#include <cstdio>
#include <cstring>
using namespace std;
int main (int argc, char const* argv[]) {
  while (true) {
    char map[8][9];
    memset(map, '0', sizeof map);
    if (EOF == scanf("%s",map[0])) break;
    for (int i=1;i<8;i++) scanf("%s",map[i]);
    
    for (int i = 0; i < 8; i += 1) {
      for (int j = 0; j < 8; j += 1) {
        if (map[i][j] == '1') {
          // A
          if (i < 7 && j < 7) {
            if (map[i][j+1]=='1'&&map[i+1][j]=='1'&&map[i+1][j+1]=='1') {
              cout<<"A"<<endl;
              goto out;
            }
          }
          // B
          if (i < 5) {
            if (map[i+1][j]=='1'&&map[i+2][j]=='1'&&map[i+3][j]=='1') {
              cout<<"B"<<endl;
              goto out;
            }
          }
          // C
          if (j < 5) {
            if (map[i][j+1]=='1'&&map[i][j+2]=='1'&&map[i][j+3]=='1') {
              cout<<"C"<<endl;
              goto out;
            }
          }
          // D
          if (i < 6) {
            if (map[i+1][j]=='1'&&map[i-1][j-1]=='1'&&map[i-2][j-1]=='1') {
              cout<<"D"<<endl;
              goto out;
            }
          }
          // E
          if (i < 7 && j < 6) {
            if (map[i][j+1]=='1'&&map[i+1][j+1]=='1'&&map[i+1][j+2]=='1') {
              cout<<"E"<<endl;
              goto out;
            }
          }
          // F
          if (i < 6 && j < 7) {
            if (map[i+1][j]=='1'&&map[i+1][j+1]=='1'&&map[i+2][j+1]=='1') {
              cout<<"F"<<endl;
              goto out;
            }
          }
          // G
          if (i < 7 && j < 5) {
            if (map[i][j+1]=='1'&&map[i+1][j]=='1'&&map[i+1][j-1]=='1') {
              cout<<"G"<<endl;
              goto out;
            }
          }
        }
      }
    }
    out:;
    //scanf("%s",map[0]);
  }
  return 0;
}