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:
def calcut(x,etalon,dl,l,n,t):  
 s=0 
 for i in range(n+t):
    if (x[0][i]==x[0][l-1-i]): 
         
         for y in range(dl):
            if (x[0][i]==etalon[y]) :
                s=s+1
    else:
       if (x[0][i]=="b")and(x[0][l-1-i]=="d") or (x[0][i]=="d")and(x[0][l-1-i]=="b"):
            s=s+1
       elif (x[0][i]=="p")and(x[0][l-1-i]=="q") or (x[0][i]=="q")and(x[0][l-1-i]=="p"):
            s=s+1
       else:
        print("NIE")
        
        break
 else:
     if s==n+t:
         print("TAK")
     else:
         print("NIE")
         



x=input().split()
etalon=["A","H","I","M","O","o","T","U","V","v","W","w","X","x","Y"]
dl=len(etalon)
l=len(x[0])
n=l//2

if n==0:
    for y in range(dl):
            if (x[0][0]==etalon[y]) :
                 print("TAK")
                 break
            elif y+1==dl:
                print("NIE")
                break
elif l%2!=0:
               calcut(x,etalon,dl,l,n,1)
else:
    
                 calcut(x,etalon,dl,l,n,0)