Problem: Let's call a string "s-palindrome" if it is symmetric about the middle of the string. For example, the string "oHo" is "s-palindrome", but the string "aa" is not. The string "aa" is not "s-palindrome", because the second half of it is not a mirror reflection of the first half.

<image> English alphabet

You are given a string s. Check if the string is "s-palindrome".

Input

The only line contains the string s (1 ≤ |s| ≤ 1000) which consists of only English letters.

Output

Print "TAK" if the string s is "s-palindrome" and "NIE" otherwise.

Examples

Input

oXoxoXo


Output

TAK


Input

bod


Output

TAK


Input

ER


Output

NIE

Solution (in PYTHON3):

Solution:
s = input()
n = len(s)
pair = {
        "a" : -1, "A" : "A",
        "b" : "d", "B" : -1,
        "c" : -1, "C" : -1,
        "d" : "b", "D" : -1,
        "e" : -1, "E" : -1,
        "f" : -1, "F" : -1,
        "g" : -1, "G" : -1,
        "h" : -1, "H" : "H",
        "i" : -1, "I" : "I",
        "j" : -1, "J" : -1,
        "k" : -1, "K" : -1,
        "l" : -1, "L" : -1,
        "m" : -1, "M" : "M",
        "n" : -1, "N" : -1,
        "o" : "o", "O" : "O",
        "p" : "q", "P" : -1,
        "q" : "p", "Q" : -1,
        "r" : -1, "R" : -1,
        "s" : -1, "S" : -1,
        "t" : -1, "T" : "T",
        "u" : -1, "U" : "U",
        "v" : "v", "V" : "V",
        "w" : "w", "W" : "W",
        "x" : "x", "X" : "X",
        "y" : -1, "Y" : "Y",
        "z" : -1, "Z" : -1
       }
ans = "TAK"
for i in range((n - 1) // 2 + 1):
    if pair[s[i]] != s[n - 1 - i]:
        ans = "NIE"
        break
print(ans)