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:
##n = int(input())
##a = list(map(int, input().split()))
##print(" ".join(map(str, res)))

def check1(a):
    if a == 'A' or a == 'H' or \
        a == 'I' or a == 'M' or \
        a == 'O' or a == 'o' or \
        a == 'T' or a == 'U' or \
        a == 'V' or a == 'v' or \
        a == 'W' or a == 'w' or \
        a == 'X' or a == 'x' or \
        a == 'Y':
        return True
    else:
        return False

def check(a, b):
    if a == b:
        return check1(a)
    else:
        if (a == 'b' and b == 'd') or \
            (a == 'd' and b == 'b'):
            return True
        if (a == 'p' and b == 'q') or \
            (a == 'q' and b == 'p'):
            return True
        return False

s = input()
n = len(s)

for i in range(int(n/2)):
    a = s[i]
    b = s[n-1-i]
    if check(a, b) == False:
        print('NIE')
        exit(0)

if n%2 != 0:
    a = s[int(n/2)]
    if check1(a) == False:
        print('NIE')
        exit(0)

print('TAK')