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:
# your code goes here
str1 = raw_input()
list1 = ['A','I','U','V','v','W','w','Y','X','x','O','o','H','M','T']
n = len(str1)
flag = 0
if n % 2:
    mid = n / 2
    #if (str1[mid] in list1):
    #        flag = 1
    #else:
    #        flag = 0
    if n == 1 and str1[0] in list1:
        flag = 1
    else:
        for i in xrange(mid+1):
            if i < mid:
                if (str1[i] in list1) and (str1[-(i+1)] in list1) and (str1[i] == str1[-(i+1)]):
                    flag = 1
                elif (str1[i] == 'b' and str1[-(i+1)] == 'd') or (str1[i] == 'd' and str1[-(i+1)] == 'b'):
                    flag = 1
                elif (str1[i] == 'q' and str1[-(i+1)] == 'p') or (str1[i] == 'p' and str1[-(i+1)] == 'q'):
                    flag = 1
                else:
                    flag = 0
                    break
            if (str1[mid] in list1):
                flag = 1
            else:
                flag = 0
                break

else:
    mid = n/2 - 1
    mid1 = n/2
    for i in xrange(mid1 + 1):
        if (str1[mid] in list1 and str1[mid1] in list1 and str1[mid] == str1[mid1]):
            flag = 1
        elif (str1[mid] == "b"and str1[mid1] == "d") or (str1[mid] == "d" and str1[mid1] == "b"):
            flag = 1
        else:
            flag = 0
            break
        if i < mid:
            if (str1[i] in list1) and (str1[-(i+1)] in list1) and (str1[i] == str1[-(i+1)]):
                flag = 1
            elif (str1[i] == 'b' and str1[-(i+1)] == 'd') or (str1[i] == 'd' and str1[-(i+1)] == 'b'):
                flag = 1
            elif (str1[i] == 'p' and str1[-(i+1)] == 'q') or (str1[i] == 'q' and str1[-(i+1)] == 'p'):
                flag = 1
            else:
                flag =0
                break


if flag == 1:
    print "TAK"
else:
    print "NIE"