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:
'''
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.

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
'''

import os,re,sys,argparse, itertools


def do_parse_args():
    stringDict = {'b':'d', 'd':'b', 'p':'q', 'q':'p',}
    stringVal = raw_input().strip()
    stringLen = len(stringVal)
    output = "NIE"
    if stringLen:
        if (stringLen%2 == 1) and (stringVal[stringLen/2] in "AHIMOoTUVvYWwXx"):
            output = 'TAK'

        if output == "TAK" or (stringLen%2 == 0):
            output = "TAK"
            for i in range(stringLen/2):
                first = stringVal[i]
                last = stringVal[-(1+i)]
                if not((first in 'bdqp' and stringDict[first] == last) or ((first == last) and (first in "AHIMOoTUVvYWwXx"))):
                    output = "NIE"
                    break
    print output





def main(argv):

    status = 0

    try:
        do_parse_args()
    except Exception as e:
        print "ERROR: " + str(e)
        status = 1

    finally:
        return status


if __name__ == "__main__":
    main(sys.argv)