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.text.DecimalFormat;
import java.util.Scanner;

public class sample1 {


	public static char mirroir(char x){
		char ret = ' ';
		switch(x){
		 case 'A' : { ret = 'A';break;}
		 case 'b' : { ret = 'd';break;}
		 case 'H' : { ret = 'H';break;}
		 case 'I' : { ret = 'I';break;}
		 case 'T' : { ret = 'T';break;}
		 case 'd' : { ret = 'b';break;}
		 case 'o' : { ret = 'o';break;}
		 case 'O' : { ret = 'O';break;}
		 case 'U' : { ret = 'U';break;}
		 case 'V' : { ret = 'V';break;}
		 case 'v' : { ret = 'v';break;}
		 case 'W' : { ret = 'W';break;}
		 case 'w' : { ret = 'w';break;}
		 case 'X' : { ret = 'X';break;}
		 case 'x' : { ret = 'x';break;}
		 case 'M' : { ret = 'M';break;}
		 case 'Y' : { ret = 'Y';break;}
		 case 'q' : { ret = 'p';break;}
		 case 'p' : { ret = 'q';break;}
		}
		return ret;
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String in = sc.next();
		int i=0,j=0,k;
		String in1 = in.substring(0, in.length()/2);
		String in2 = (in.substring(in.length() - in.length()/2,in.length()));
		k=in2.length()-1;
//		System.out.println(in1+ " " + in2);
		if(in.length() % 2 == 0){
			if(in1.length()==in2.length() && in.length() !=1 ){
				while(i<in1.length() && k>=0){
					if( in1.charAt(i)==mirroir(in2.charAt(k)) ){
						//System.out.println(in1.charAt(i)+" "+in2.charAt(k));
						j++;	}
					i++;
					k--;
				}
				//System.out.println(j+" "+in1.length());
				if(j==in1.length()) System.out.println("TAK");
				else System.out.println("NIE");
			}
			else{
				if(in.charAt(0)==mirroir(in.charAt(0))) System.out.println("TAK");
				else System.out.println("NIE");
			}
			
		}else{
			if(in1.length()==in2.length() && in.length() !=1 ){
				while(i<in1.length() && k>=0){
					if(in1.charAt(i)==mirroir(in2.charAt(k)) ){
					//	System.out.println(in1.charAt(i)+" "+in2.charAt(k));
						j++;
					}
					i++;
					k--;
				}
//				System.out.println(j+" "+in1.length());
				if(j==in1.length() && in.charAt(in1.length())==mirroir(in.charAt(in1.length()))) System.out.println("TAK");
				else System.out.println("NIE");
			}
			else{
				if(in.charAt(0)==mirroir(in.charAt(0))) System.out.println("TAK");
				else System.out.println("NIE");
			}

		}
	
	}


}