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:
midsym = 'AHIMOoTUVvWwXxY'
sym = 'pqbd'

s = input()

if len(s) % 2 == 1:
	t = len(s) // 2
	if s[t] not in midsym:
		print('NIE')
		exit()
	s = s[:t] + s[t+1:]

#print(s)
	
f = s[:int(len(s)/2)]
l = s[int(len(s)/2):]
l = l[::-1]
for k in range(len(f)):
	if f[k] not in midsym and f[k] not in sym:
		print('NIE')
		exit()
	if f[k] in midsym:
		if l[k] != f[k]:
			print('NIE')
			exit()
	if f[k] in sym:
		if f[k] == 'p' and l[k] == 'q': continue
		if f[k] == 'q' and l[k] == 'p': continue
		if f[k] == 'b' and l[k] == 'd': continue
		if f[k] == 'd' and l[k] == 'b': continue
		print('NIE')
		exit()
print('TAK')