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.*;

public class test {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String input = sc.next();
		int length = input.length();
		
		if(length % 2 == 0){
			printOutput(checkNumber(input,length));
		}
		else{
			char val = input.charAt(length/2); 
			if(check(val)){
				printOutput(checkNumber(input,length));
			}
			else{
				printOutput(false);
			}
		}
		
	}
	
	//return true if sym
	public static boolean checkNumber(String input, int length){
		for(int i = 0; i < length/2; i++){
			//System.out.println(input.charAt(i) + " : " + input.charAt(length-1-i));
			if((input.charAt(i) == 'b' && input.charAt(length-1-i) == 'd') || (input.charAt(i) == 'd' && input.charAt(length-1-i) == 'b')){
				//b and d case
			}
			else if((input.charAt(i) == 'p' && input.charAt(length-1-i) == 'q') || (input.charAt(i) == 'q' && input.charAt(length-1-i) == 'p')){
				//p and q case
			}
			else if(input.charAt(i) == input.charAt(length-1-i)){
				if(!check(input.charAt(i) ) || !check(input.charAt(length-1-i))){
					//check if they are a symmetric pair
					return false;
				}
			}
			else{
				return false;
			}
		}
		return true;
	}
	
	public static boolean check(char val){
		if(val == 'A' || val == 'H' || val == 'I' || val == 'M' || val == 'O' || val == 'o' || val == 'T' || val == 'U' || val == 'V' || val == 'v' || val == 'W' || val == 'w' || val == 'X' || val == 'x' || val == 'Y'){
			return true;
		}
		return false;
	}
	
	public static void printOutput(boolean response){
		if(response){
			System.out.println("TAK");
		}
		else{
			System.out.println("NIE");
		}
	}
}