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()
c=0
for i in range(len(S)//2) :
    if S[i]=='A' and S[len(S)-1-i]=='A' or S[i]=='b' and S[len(S)-i-1]=='d' or S[i]=='H' and S[len(S)-i-1]=='H' or S[i]=='I' and S[len(S)-i-1]=='I' or S[i]=='d' and S[len(S)-i-1]=='b' or S[i]=='M' and S[len(S)-i-1]=='M'  or S[i]=='O' and S[len(S)-i-1]=='O' or S[i]=='o' and S[len(S)-i-1]=='o' or S[i]=='T' and S[len(S)-i-1]=='T' or S[i]=='U' and S[len(S)-i-1]=='U' or S[i]=='V' and S[len(S)-i-1]=='V' or S[i]=='v' and S[len(S)-i-1]=='v' or S[i]=='W' and S[len(S)-i-1]=='W' or S[i]=='w' and S[len(S)-i-1]=='w' or S[i]=='X' and S[len(S)-i-1]=='X' or S[i]=='x' and S[len(S)-i-1]=='x' or S[i]=='Y' and S[len(S)-i-1]=='Y' or S[i]=='p' and S[len(S)-i-1]=='q' or S[i]=='q' and S[len(S)-i-1]=='p':
        k=1
    else :
        c=1
        break
if len(S)%2!=0 :
    if S[len(S)//2]=='A' or S[len(S)//2]=='X' or S[len(S)//2]=='o' or S[len(S)//2]=='O' or S[len(S)//2]=='x' or S[len(S)//2]=='Y' or S[len(S)//2]=='I' or S[len(S)//2]=='M'  or S[len(S)//2]=='H' or S[len(S)//2]=='T' or S[len(S)//2]=='U'  or S[len(S)//2]=='V' or S[len(S)//2]=='v' or S[len(S)//2]=='W' or S[len(S)//2]=='w' :
        if c==0 :
            print('TAK')
        else :
            print('NIE')
    else :
        print('NIE')
else :
    if c==1 :
        print('NIE')
    else :
        print('TAK')