/* ??????????????´ */

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

int field[8][8];

int adx[] = {0, 0, 1, 1};
int ady[] = {0, 1, 0, 1};

int bdx[] = {0, 0, 0, 0};
int bdy[] = {0, 1, 2, 3};

int cdx[] = {0, 1, 2, 3};
int cdy[] = {0, 0, 0, 0};

int ddx[] = {0, 1, 1, 0};
int ddy[] = {0, 0, -1, 1};

int edx[] = {0, 1, 1, 2};
int edy[] = {0, 0, 1, 1};

int fdx[] = {0, 0, 1, 1};
int fdy[] = {0, 1, 1, 2};

int gdx[] = {0, 1, 0, -1};
int gdy[] = {0, 0, 1, 1};


bool WithinRange(int y, int x) {
  if (x < 0) return false;
  if (x >= 8) return false;
  if (y < 0) return false;
  if (y >= 8) return false;

  return true;
}

bool Match(int *dx, int *dy) {
  for (int i=-2; i<10; i++) {
    for (int j=-2; j<10; j++) {
      int sum = 0;

      for (int k=0; k<4; k++) {
        int newy = i+dy[k];
        int newx = j+dx[k];
        if (WithinRange(newy, newx)) sum += field[newy][newx];
      }

      if (sum == 4) return true;
    }
  }

  return false;
}

int main() {
  while (1) {
    for (int i=0; i<8; i++) {
      for (int j=0; j<8; j++) {
        char c;
        if (scanf(" %c", &c) != 1) return 0;
        field[i][j] = (c == '1');
      }
    }

    if (Match(adx, ady)) puts("A");
    else if (Match(bdx, bdy)) puts("B");
    else if (Match(cdx, cdy)) puts("C");
    else if (Match(ddx, ddy)) puts("D");
    else if (Match(edx, edy)) puts("E");
    else if (Match(fdx, fdy)) puts("F");
    else if (Match(gdx, gdy)) puts("G");
    else assert(0);
  }
}