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:
 /**
 *
 * @author: andcaif1
 * @version 1.00 2016/8/18
 * Palindrome-CodeForce
 */

import java.util.*;
import java.lang.*;

public class PalindromeMain {

	public static void main(String[] args) {
		Scanner sn = new Scanner (System.in);
		String strLineaIn = new String();
		String strTemp1 = new String();    
    	String strTemp2 = new String();
    	boolean resultado=false; 
    	   	
    	
		while(sn.hasNext()){    		
    		strLineaIn = sn.nextLine();
    		    		   				
    		for (int i=0, j=strLineaIn.length()-1; i<=strLineaIn.length()/2;i++,j--){    			
    			strTemp1 = strLineaIn.substring(i,i+1);
    			strTemp2 = strLineaIn.substring(j,j+1);
    			//System.out.println("primera mitad: " + strTemp1 + " Segunda Mitad: " + strTemp2);
    			if (isReflect(strTemp1, strTemp2))
    				resultado = true;
    			else{
    				resultado = false;
    				break;
    			}
    		}
    		if (resultado)
    			System.out.println("TAK");
    		else
    			System.out.println("NIE");    		
    	}

	}
	
	
	private static boolean isReflect(String s, String s1){
		
		String strFirstHalf = new String (s);
		String strSecondHalf = new String (s1);
				
		
		if (strFirstHalf.compareTo("A") == 0 && strSecondHalf.compareTo("A") == 0)
			return true;			
		else if (strFirstHalf.compareTo("b") == 0 && strSecondHalf.compareTo("d") == 0)
			return true;
		else if (strFirstHalf.compareTo("d") == 0 && strSecondHalf.compareTo("b") == 0)
			return true;
		else if (strFirstHalf.compareTo("H") == 0 && strSecondHalf.compareTo("H") == 0)
			return true;
		else if (strFirstHalf.compareTo("I") == 0 && strSecondHalf.compareTo("I") == 0)
			return true;
		else if (strFirstHalf.compareTo("M") == 0 && strSecondHalf.compareTo("M") == 0)
			return true;
		else if (strFirstHalf.compareTo("O") == 0 && strSecondHalf.compareTo("O") == 0)
			return true;
		else if (strFirstHalf.compareTo("o") == 0 && strSecondHalf.compareTo("o") == 0)
			return true;
		else if (strFirstHalf.compareTo("p") == 0 && strSecondHalf.compareTo("q") == 0)
			return true;
		else if (strFirstHalf.compareTo("q") == 0 && strSecondHalf.compareTo("p") == 0)
			return true;
		else if (strFirstHalf.compareTo("T") == 0 && strSecondHalf.compareTo("T") == 0)
			return true;
		else if (strFirstHalf.compareTo("U") == 0 && strSecondHalf.compareTo("U") == 0)
			return true;
		else if (strFirstHalf.compareTo("V") == 0 && strSecondHalf.compareTo("V") == 0)
			return true;
		else if (strFirstHalf.compareTo("v") == 0 && strSecondHalf.compareTo("v") == 0)
			return true;
		else if (strFirstHalf.compareTo("W") == 0 && strSecondHalf.compareTo("W") == 0)
			return true;
		else if (strFirstHalf.compareTo("w") == 0 && strSecondHalf.compareTo("w") == 0)
			return true;
		else if (strFirstHalf.compareTo("X") == 0 && strSecondHalf.compareTo("X") == 0)
			return true;
		else if (strFirstHalf.compareTo("x") == 0 && strSecondHalf.compareTo("x") == 0)
			return true;
		else if (strFirstHalf.compareTo("Y") == 0 && strSecondHalf.compareTo("Y") == 0)
			return true;
		else
			return false;
	}

}