#include <iostream>
#include <vector>
#include <string>
#include <cstring>

class FIELD {
public:
  FIELD(int w, int h) : m_w(w), m_h(h) {
    m_pData = new char[m_w * m_h];
  }
  FIELD(int w, int h, const char* pc) : m_w(w), m_h(h) {
    m_pData = new char[m_w * m_h];
    for (int y = 0; y < m_h; y++) {
      for (int x = 0; x < m_w; x++) {
        at(x, y) = *(pc + x + y * m_w) == ' ' ? '0' : '1';
      }
    }
  }
  ~FIELD() {
    delete[] m_pData;
  }
  const char& at(int x, int y) const {
    return *(m_pData + x + y * m_w);
  }
  char& at(int x, int y) {
    return *(m_pData + x + y * m_w);
  }
  int GetWidth() const {
    return m_w;
  }
  int GetHeight() const {
    return m_h;
  }
  bool set() {
    for (int y = 0; y < m_h; y++) {
      std::string line;
      std::cin >> line;
      if (std::cin.eof()) {
        return false;
      }
      std::memcpy(m_pData + y * m_w, line.c_str(), m_w);
    }
    return true;
  }
  void echo() const {
    for (int y = 0; y < m_h; y++) {
      for (int x = 0; x < m_w; x++) {
        std::cout << at(x, y);
      }
      std::cout << std::endl;
    }
  }

private:
  int m_w;
  int m_h;

  char* m_pData;
};

static const FIELD patA(2, 2,
  "**"
  "**"
);

static const FIELD patB(1, 4,
  "*"
  "*"
  "*"
  "*"
);

static const FIELD patC(4, 1,
  "****"
);

static const FIELD patD(2, 3,
  " *"
  "**"
  "* "
);

static const FIELD patE(3, 2,
  "** "
  " **"
);

static const FIELD patF(2, 3, 
  "* "
  "**"
  " *"
);

static const FIELD patG(3, 2,
  " **"
  "** "
);

bool matchTemplate_core(const FIELD& src, const FIELD& templ, int x, int y) {

  for (int yy = 0; yy < templ.GetHeight(); yy++) {
    for (int xx = 0; xx < templ.GetWidth(); xx++) {
      if (src.at(x + xx, y + yy) != templ.at(xx, yy)) {
        return false;
      }
    }
  }

  return true;
}

bool matchTemplate(const FIELD& src, const FIELD& templ) {
  int rangeW = src.GetWidth() - templ.GetWidth();
  int rangeH = src.GetHeight() - templ.GetHeight();

  if (rangeW < 0 || rangeH < 0) {
    return false;
  }

  for (int y = 0; y <= rangeH; y++) {
    for (int x = 0; x <= rangeW; x++) {
      if (matchTemplate_core(src, templ, x, y)) {
        return true;
      }
    }
  }

  return false;
}

int main(void)
{
  FIELD f(8, 8);

  while (f.set()) {
    if (matchTemplate(f, patA)) std::cout << 'A' << std::endl;
    if (matchTemplate(f, patB)) std::cout << 'B' << std::endl;
    if (matchTemplate(f, patC)) std::cout << 'C' << std::endl;
    if (matchTemplate(f, patD)) std::cout << 'D' << std::endl;
    if (matchTemplate(f, patE)) std::cout << 'E' << std::endl;
    if (matchTemplate(f, patF)) std::cout << 'F' << std::endl;
    if (matchTemplate(f, patG)) std::cout << 'G' << std::endl;
  }

  return 0;
}
