#include <bits/stdc++.h>
using namespace std;
vector<string> vec(4);
bool exist[8][8];
bool alive(long long int X, long long int Y) {
  for (long long int i = 0; i < ((long long int)2); i++) {
    long long int x = vec[i][0] - 'a';
    long long int y = vec[i][1] - '1';
    if (x == X && y == Y) continue;
    long long int tmp = x - 1;
    while (0 <= tmp) {
      if (X == tmp && Y == y) return false;
      if (exist[tmp][y]) break;
      tmp--;
    }
    tmp = x + 1;
    while (tmp < 8) {
      if (X == tmp && Y == y) return false;
      if (exist[tmp][y]) break;
      tmp++;
    }
    tmp = y - 1;
    while (0 <= tmp) {
      if (X == x && Y == tmp) return false;
      if (exist[x][tmp]) break;
      tmp--;
    }
    tmp = y + 1;
    while (tmp < 8) {
      if (X == x && Y == tmp) return false;
      if (exist[x][tmp]) break;
      tmp++;
    }
  }
  for (long long int i = 0; i < ((long long int)3); i++)
    for (long long int j = 0; j < ((long long int)3); j++) {
      long long int x = vec[2][0] - 'a' + i - 1;
      long long int y = vec[2][1] - '1' + j - 1;
      if (x < 0 || 8 <= x || y < 0 || 8 <= y) continue;
      if (x == X && y == Y) return false;
    }
  return true;
}
bool checkmate() {
  for (long long int i = 0; i < ((long long int)3); i++)
    for (long long int j = 0; j < ((long long int)3); j++) {
      long long int x = vec[3][0] - 'a' + i - 1;
      long long int y = vec[3][1] - '1' + j - 1;
      if (x < 0 || 8 <= x || y < 0 || 8 <= y) continue;
      if (alive(x, y)) return false;
    }
  return true;
}
int main() {
  for (long long int i = 0; i < ((long long int)4); i++) cin >> vec[i];
  for (long long int i = 0; i < ((long long int)8); i++)
    for (long long int j = 0; j < ((long long int)8); j++) exist[i][j] = false;
  for (long long int i = 0; i < ((long long int)3); i++) {
    long long int x = vec[i][0] - 'a';
    long long int y = vec[i][1] - '1';
    exist[x][y] = true;
  }
  if (!checkmate())
    cout << "OTHER" << endl;
  else
    cout << "CHECKMATE" << endl;
}
