/* ??? ??? ??? ??? ??? */

#include <cstdio>
using namespace std;

int field[8][8];

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;
}

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');
      }
    }

    bool has_decided = false;
    for (int i=0; i<7; i++) {
      for (int j=0; j<7; j++) {
        int sum = 0;
        for (int p=0; p<2; p++) {
          for (int q=0; q<2; q++) {
            sum += field[i+p][j+q];
          }
        }

        if (sum == 4 && !has_decided) {
          puts("A");
          has_decided = true;
        }
      }
    }

    if (has_decided) continue;

    for (int i=0; i<7; i++) {
      for (int j=0; j<4; j++) {
        int sum = 0;
        for (int k=0; k<4; k++) {
          sum += field[i][j+k];
        }

        if (sum == 4 && !has_decided) {
          puts("C");
          has_decided = true;
        }
      }
    }
    if (has_decided) continue;

    for (int j=0; j<7; j++) {
      for (int i=0; i<4; i++) {
        int sum = 0;
        for (int k=0; k<4; k++) {
          sum += field[i+k][j];
        }

        if (sum == 4 && !has_decided) {
          puts("B");
          has_decided = true;
        }
      }
    }
    if (has_decided) continue;

    for (int i=0; i<8; i++) {
      for (int j=0; j<8; j++) {
        int dx[] = {1, 1, 0, 0};
        int dy[] = {-1, 0, 0, 1};
        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 && !has_decided) {
          puts("D");
          has_decided = true;
        }
      }
    }
    if (has_decided) continue;
    
    for (int i=0; i<8; i++) {
      for (int j=0; j<8; j++) {
        int dx[] = {1, 1, 0, 2};
        int dy[] = {1, 0, 0, 1};
        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 && !has_decided) {
          puts("E");
          has_decided = true;
        }
      }
    }
    if (has_decided) continue;

    for (int i=0; i<8; i++) {
      for (int j=0; j<8; j++) {
        int dx[] = {1, 0, 0, 1};
        int dy[] = {1, 1, 0, 2};
        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 && !has_decided) {
          puts("F");
          has_decided = true;
        }
      }
    }
    if (has_decided) continue;

    for (int i=0; i<8; i++) {
      for (int j=0; j<8; j++) {
        int dx[] = {-1, 0, 0, 1};
        int dy[] = {1, 1, 0, 0};
        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 && !has_decided) {
          puts("G");
          has_decided = true;
        }
      }
    }
    if (has_decided) continue;
  }
}
 