#include <bits/stdc++.h>

using namespace std;

char x[7][4][5] = {
  {
    "1100",
    "1100",
    "0000",
    "0000"
  },
  {
    "1000",
    "1000",
    "1000",
    "1000"
  },
  {
    "1111",
    "0000",
    "0000",
    "0000"
  },
  {
    "0100",
    "1100",
    "1000",
    "0000"
  },
  {
    "1100",
    "0110",
    "0000",
    "0000"
  },
  {
    "1000",
    "1100",
    "0100",
    "0000"
  },
  {
    "0110",
    "1100",
    "0000",
    "0000"
  }
};

int main(void) {
  vector<string> input(8);
  while (cin >> input[0]) {
    for (int i = 1; i < 8; i++) {
      cin >> input[i];
    }

    char s[11][11];
    memset(s, '0', sizeof(s));

    for (int i = 0; i < 8; i++) {
      for (int j = 0; j < 8; j++) {
        s[i][j] = input[i][j];
      }
    }

    int ans = -1;
    for (int i = 0; i < 7; i++) {
      for (int j = 0; j < 8; j++) {
        for (int k = 0; k < 8; k++) {
          bool find = true;
          for (int l = 0; l < 4; l++) {
            for (int m = 0; m < 4; m++) {
              find &= s[j + l][k + m] == x[i][l][m]; 
            }
          }
          if (find) ans = i;
        }
      }
    }

    cout << (char)(ans + 'A') << endl;
  }

  return 0;
}
