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:
word = input()

l = len(word)

hasmid = ["A", "H", "I", "M", "O", "o", "T", "U", "V", "v", "W", "w", "X", "x", "Y"]

reflections = [("b","d"), ("d","b"), ("q","p"), ("p","q")]

if l % 2 == 1:
    if word[int((l-1)/2)] in hasmid:
        for i in range(l):
            if i != (l-1)/2:
                if word[i] in hasmid:
                    if word[l-i-1] in hasmid:
                        if word[i] == word[l-i-1]:
                            continue
                        else:
                            print("NIE")
                            exit()
                    else:
                        print("NIE")
                        exit()
                else:
                    refl = False
                    for pair in reflections:
                        if word[i] == pair[0]:
                            if word[l-i-1] == pair[1]:
                                refl = True
                                break
                    if refl:
                        continue
                    else:
                        print("NIE")
                        exit()
    else:
        print("NIE")
        exit()
else:
    for i in range(l):
        if word[i] in hasmid:
            if word[l-i-1] in hasmid:
                if word[i] == word[l-i-1]:
                    continue
                else:
                    print("NIE")
                    exit()
            else:
                print("NIE")
                exit()
        else:
            refl = False
            for pair in reflections:
                if word[i] == pair[0]:
                    if word[l-i-1] == pair[1]:
                        refl = True
                        break
            if refl:
                continue
            else:
                print("NIE")
                exit()
                
print("TAK")