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:
tak = {
    'b': 'd',
    'd': 'b',
    'p': 'q',
    'q': 'p'
}

tok = 'AHIMOoTUVvWwXxY'

s = input()
le = len(s)
le2 = le // 2

if (1 == le & 1) and not s[le2] in tok:
    print("NIE")
    exit()
    
s1 = s[0:le2]
s2 = s[le2 + (le & 1):][::-1]



for i in range(0, le2):
    
    if s1[i] == s2[i] and s1[i] in tok: continue
    if s1[i] in tak and tak[s1[i]] == s2[i]: continue
    print("NIE")
    exit()
    
print("TAK")