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 prac {
	 public static void main(String[] args) {
	        Scanner get=new Scanner(System.in);
	        String s1=get.nextLine();
	        char a[]={'A','H','I','M','O','o','T','U','V','v','W','w','X'
	        		,'x','Y'};
	        int state=0;
	        for(int i=0;i<s1.length()/2;i++)
	        {
	        	if(s1.charAt(i)=='b')
	        	{
	        		if(s1.charAt(s1.length()-1-i)!='d')
	        			state=1;
	        	}
	        	else if(s1.charAt(i)=='d')
	        	{
	        		if(s1.charAt(s1.length()-1-i)!='b')
	        			state=1;
	        		
	        	}
	        	else if(s1.charAt(i)=='p')
	        	{
	        		if(s1.charAt(s1.length()-1-i)!='q')
	        			state=1;
	        	}
	        	else if(s1.charAt(i)=='q')
	        	{
	        		if(s1.charAt(s1.length()-1-i)!='p')
	        			state=1;
	        	}
	        	else
	        	{
	        		int flag=0;
	        		for(int j=0;j<a.length;j++)
	        		{
	        			if(a[j]==s1.charAt(i))
	        			{
	        				flag=1;
	        				break;
	        			}
	        		}
	        		if(flag==0)
	        		{
	        			state=1;
	        			break;
	        		}
	        		else if(s1.charAt(s1.length()-i-1)!=s1.charAt(i))
	        			state=1;
	        	}
	        }
	        if(s1.length()%2==1)
	        {
	        	int flag=0;
	        	for(int i=0;i<a.length;i++)
	        	{
	        		if(s1.charAt(s1.length()/2)==a[i])
	        			flag=1;
	        	}
	        	if(flag==0)
	        		state=1;
	        }
	        System.out.println(state==0?"TAK":"NIE");
	        
	        }
	        
	        
	 }