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.*;
import java.io.*;
public class edu14Q2
{
	public static void main(String[] args)throws IOException
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String str=br.readLine();
		int n=str.length();
		Set<Character> set=new HashSet<Character>();
		set.add('A');set.add('H');set.add('I');set.add('M');set.add('O');
		set.add('T');set.add('U');set.add('V');
		set.add('W');set.add('X');set.add('Y');
		Set<Character> set2=new HashSet<Character>();
		set2.add('o');set2.add('v');set2.add('w');set2.add('x');
		int flag=0;
		int mid=0;
		if(n%2==0)
			mid=n/2 -1 ;
		else 
			mid=n/2;
		for(int i=0;i<=mid;i++)
		{
			char c=str.charAt(i);
			char c2=str.charAt(n-i-1);
			//System.out.println(c+" "+c2);
			if(Character.isUpperCase(c))
			{
				if(c==c2 && set.contains(c))
					flag=0;
				else
					flag=1;
			}
			
			else
			{
				
				if(set2.contains(c) && (c==c2))
					flag=0;
					
				else if ( ((c=='p') && (c2=='q')) || ( (c=='b') && (c2=='d') ) )		
					flag=0;
				else if ( ((c2=='p') && (c=='q')) || ( (c2=='b') && (c=='d') ) )		
					flag=0;
					
				else
					flag=1;
			}
					
			if(flag==1)
			{
				System.out.println("NIE");
				break;
			}
		}
		if(flag==0)
		System.out.println("TAK");
	}
}