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 JAVA):

Solution:


import java.util.Scanner;

public class sPalindrome {
	public static boolean checkLetter(char c)
	{
		if (c=='A')
			return true;
		if (c=='H')
			return true;
		if (c=='I')
			return true;
		if (c=='M')
			return true;
		if (c=='O')
			return true;
		if (c=='o')
			return true;
		if (c=='T')
			return true;
		if (c=='U')
			return true;
		if (c=='V')
			return true;
		if (c=='v')
			return true;
		if (c=='W')
			return true;
		if (c=='w')
			return true;
		if (c=='X')
			return true;
		if (c=='x')
			return true;
		if (c=='Y')
			return true;
		return false;
	}
	public static boolean checkPair(char a,char b)
	{
		if (a=='b' && b=='d')
			return true;
		if (a=='d' && b=='b')
			return true;
		if (a=='p' && b=='q')
			return true;
		if (a=='q' && b=='p')
			return true;
		return false;
	}
	public static void main(String args[])
	{
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		boolean flag = true;
		if (s.length()%2==1)
		{
			flag = checkLetter(s.charAt(s.length()/2));
		}
		for (int i=0;i<s.length()/2&&flag;i++)
		{
			flag = checkLetter(s.charAt(i))&&(s.charAt(i)==s.charAt(s.length()-i-1));
			if (flag)
				continue;
			flag = checkPair(s.charAt(i),s.charAt(s.length()-i-1));
		}
		if (flag)
			System.out.println("TAK");
		else
			System.out.println("NIE");
	}
}