42_B. Game of chess unfinished
Once Volodya was at the museum and saw a regular chessboard as a museum piece. And there were only four chess pieces on it: two white rooks, a white king and a black king. "Aha, blacks certainly didn't win!", — Volodya said and was right for sure. And your task is to say whether whites had won or not.

Pieces on the chessboard are guaranteed to represent a correct position (every piece occupies one cell, no two pieces occupy the same cell and kings cannot take each other). Thus, your task is only to decide whether whites mate blacks. We would remind you that it means that the black king can be taken by one of the opponent's pieces at the moment and also it cannot move to an unbeaten position. A rook moves vertically or horizontally by any number of free cells (assuming there are no other pieces on its path), a king — to the adjacent cells (either by corner or by side). Certainly, pieces cannot leave the board. The black king might be able to take opponent's rooks at his turn (see sample 3).

Input

The input contains 4 space-separated piece positions: positions of the two rooks, the white king and the black king. Each position on 8 × 8 chessboard is denoted by two symbols — ('a' - 'h') and ('1' - '8') — which stand for horizontal and vertical coordinates of the cell occupied by the piece. It is guaranteed, that no two pieces occupy the same cell, and kings cannot take each other.

Output

Output should contain one word: "CHECKMATE" if whites mate blacks, and "OTHER" otherwise.

Examples

Input

a6 b4 c8 a8


Output

CHECKMATE


Input

a6 c4 b6 b8


Output

OTHER


Input

a2 b1 a3 a1


Output

OTHER
```python
import sys
b = 'sabcdefgh'
a1,a2,a3,a4 = map(str,input().split())
x1 = b.index(a1[0])-1
y1 = int(a1[1]) -1
x2 = b.index(a2[0])-1
y2 = int(a2[1]) -1
x3 = b.index(a3[0])-1
y3 = int(a3[1]) -1
x4 = b.index(a4[0])-1
y4 = int(a4[1]) -1
c = []
for i in range(8):
    c.append([0]*8)
pr = 0
pr1 = 0
pr4 = 0
pr3 = 0
for i in range(1,8):
    if y1 - i > -1 and pr == 0:
        if (y1 - i == y2 and x1 == x2) or (y1 - i == y3 and x1 == x3):
            c[x1][y1 - i] = 1
            pr = 1
        else:
            c[x1][y1 - i] = 1
    if y1 + i < 8 and pr1 == 0:
        if (y1 + i == y2 and x1 == x2) or (y1 + i == y3 and x1 == x3):
            c[x1][y1 + i] = 1
            pr1 = 1
        else:
            c[x1][y1 + i] = 1
    if y2 - i > -1 and pr3 == 0:
        if (y2 - i == y1 and x1 == x2) or (y2 - i == y3 and x2== x3):
            c[x2][y2 - i] = 1
            pr3 = 1
        else:
            c[x2][y2 - i] = 1
    if y2 + i < 8 and pr4 == 0:
        if (y3 + i == y1 and x1 == x2) or (y2 + i == y3 and x2 == x3):
            c[x2][y2 + i] = 1
            pr4 = 1
        else:
            c[x2][y2 + i] = 1
pr = 0
pr1 = 0
pr2 = 0
pr3 = 0
for i in range(1,8):
    if x1 - i > -1 and pr == 0:
        if (x1 - i == x2 and y1 == y2) or (x1 - i == x3 and y1 == y3):
            c[x1 - i][y1] = 1
            pr = 1
        else:
            c[x1 - i][y1] = 1
    if x2 - i > -1 and pr1 == 0:
        if (x2 - i == x1 and y1 == y2) or (x2 - i == x3 and y2 == y3):
            c[x2 - i][y2] = 1
            pr1 = 1
        else:
            c[x2 - i][y2] = 1
    if x1 + i < 8 and pr2 == 0:
        if (x1 + i == x2 and y1 == y2) or (x1 + i == x3 and y1 == y3):
            c[x1 + i][y1] = 1
            pr2 = 1
        else:
            c[x1 + i][y1] = 1
    if x2 + i < 8 and pr3 == 0:
        if (x2 + i == x1 and y1 == y2) or (x2 + i == x3 and y2 == y3):
            c[x2 + i][y2] = 1
            pr3= 1
        else:
            c[x2 + i][y2] = 1
for i in range(-1,2):
    for j in range(-1,2):
        if x3 + i < 8 and x3 + i > -1 and y3 + j < 8 and y3 + j > -1:
            c[x3 + i][y3+j] = 1

for i in range(-1,2):
    for j in range(-1,2):
        if x4 + i < 8 and x4 + i > -1 and y4 + j < 8 and y4 + j > -1:
            if c[x4 + i][y4+j] == 0:
                print("OTHER")
                sys.exit()
print("CHECKMATE")

```