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:
#Code by Sounak, IIESTS
#------------------------------warmup----------------------------

import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
from collections import defaultdict
 

BUFSIZE = 8192
 
 
class FastIO(IOBase):
    newlines = 0
    
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
     
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
 
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
 
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
 
 
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
  
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

#-------------------game starts now-----------------------------------------------------
def check(a,b):
    ch=0
    if a=='b' and b=='d':
        ch=1
    elif a=='d' and b=='b':
        ch=1
    elif a=='o' and b=='o':
        ch=1
    elif a=='p' and b=='q':
        ch=1
    elif a=='q' and b=='p':
        ch=1
    elif a=='v' and b=='v':
        ch=1
    elif a=='w' and b=='w':
        ch=1
    elif a=='x' and b=='x':
        ch=1
    elif a=='A' and b=='A':
        ch=1
    elif a=='H' and b=='H':
        ch=1
    elif a=='I' and b=='I':
        ch=1
    elif a=='M' and b=='M':
        ch=1
    elif a=='O' and b=='O':
        ch=1
    elif a=='T' and b=='T':
        ch=1
    elif a=='U' and b=='U':
        ch=1
    elif a=='V' and b=='V':
        ch=1
    elif a=='W' and b=='W':
        ch=1
    elif a=='X' and b=='X':
        ch=1
    elif a=='Y' and b=='Y':
        ch=1
    return ch

s=input()
n=len(s)
ch=1
for i in range (n//2):
    c=check(s[i],s[n-i-1])
    if c==0:
        ch=0
        break
a=['A','H','I','M','O','T','U','V','W','X','Y','o','v','w','x']
if n%2==1:
    if s[n//2] not in a:
        ch=0
if ch==1:
    print("TAK")
else:
    print("NIE")