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 PYTHON):

Solution:
def ck(s):
    n = len(s)
    inv = set(['a', 'c', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'r', 's', 't', 'u', 'y', 'z', 'B', 'C', 'D', 'E', 'F', 'G', 'J', 'K', 'L', 'N', 'P', 'Q', 'R', 'S', 'Z'])

    for i in range(n):
        if s[i] in inv:
            return False
        elif (s[i] == 'b' and s[n-1-i] != 'd'):
            return False
        elif (s[i] == 'd' and s[n-1-i] != 'b'):
            return False
        elif (s[i] == 'o' and s[n-1-i] != 'o'):
            return False
        elif (s[i] == 'p' and s[n-1-i] != 'q'):
            return False
        elif (s[i] == 'q' and s[n-1-i] != 'p'):
            return False
        elif (s[i] == 'v' and s[n-1-i] != 'v'):
            return False
        elif (s[i] == 'w' and s[n-1-i] != 'w'):
            return False
        elif (s[i] == 'x' and s[n-1-i] != 'x'):
            return False

        elif (s[i] == 'A' and s[n-1-i] != 'A'):
            return False
        elif (s[i] == 'H' and s[n-1-i] != 'H'):
            return False
        elif (s[i] == 'I' and s[n-1-i] != 'I'):
            return False
        elif (s[i] == 'M' and s[n-1-i] != 'M'):
            return False
        elif (s[i] == 'O' and s[n-1-i] != 'O'):
            return False
        elif (s[i] == 'T' and s[n-1-i] != 'T'):
            return False
        elif (s[i] == 'U' and s[n-1-i] != 'U'):
            return False
        elif (s[i] == 'V' and s[n-1-i] != 'V'):
            return False
        elif (s[i] == 'W' and s[n-1-i] != 'W'):
            return False
        elif (s[i] == 'X' and s[n-1-i] != 'X'):
            return False
        elif (s[i] == 'Y' and s[n-1-i] != 'Y'):
            return False
    return True


s = str(raw_input())

if (ck(s) is True):
    print "TAK"
else:
    print "NIE"