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:
"""
s-palindrome special chars:
p - q
b - d

s-palindrome self-symmetrical chars:
A, H, I, M, N, O, o, T, U, V, v, W, w, X, x, Y


getPalindromePartner(str, idx) -> get character on other side of string

1. define list of valid pairings: (H, H), (I, I), (x, x), (p, q), (q, p), etc...
for each char in 1st half of string:
    1. getPalindromePartner
    2. if (char, PalindromePartner) in valid_pairings:
        contine
       else:
        return false
"""

def getPalindromePartner(str_in, idx):
    return str_in[len(str_in) - 1 - idx]

def solve(str_in):
    self_symmetrical_chars = "AHIMOoTUVvWwXxY"
    valid_pairings = []

    for char in self_symmetrical_chars:
        valid_pairings.append((char, char))

    valid_pairings.append(('p', 'q'))
    valid_pairings.append(('q', 'p'))
    valid_pairings.append(('b', 'd'))
    valid_pairings.append(('d', 'b'))

    for idx in range(0, len(str_in)):
        partner_char = getPalindromePartner(str_in, idx)

        if not (str_in[idx], partner_char) in valid_pairings:
            print "NIE"
            return

    print "TAK"

if __name__ == "__main__":
    str_in = raw_input()

    solve(str_in)
    #print(getPalindromePartner("mama", 3))