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.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class S_palindrome {

	
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String s = br.readLine();
		
			int x = 0;
			String s1 = "";
			String s2 = "";
			boolean flag = true;
		
			if(s.length() == 1){
				x = 0 ;
				s1 = s.charAt(0)+"";
				s2 = s1;
				
			}else
				if(s.length() %2 ==1){
			 x = (s.length())/2;
			 s1 = s.substring(0, x);
			s2 = s.substring(x+1,s.length());
			}else{
				
				
				 x = (s.length())/2;
				 s1 = s.substring(0, x);
				s2 = s.substring(x,s.length());
			}
		
			if(s.length()%2 == 1)
			{
				char c = s.charAt(x);
				if(c != 'H' && c != 'I' && c != 'A' && c != 'M' &&c != 'o' && c != 'O' && c != 'x' &&
						c != 'X' && c != 'T' &&c != 'U' &&c != 'V' && c != 'v' && c != 'W' &&c != 'w' &&
						c != 'Y'){
					flag = false;
					
				}
				

				
			}
		
			if(flag)
			for (int i = 0; i < s1.length(); i++) {
				if(s1.charAt(i) == s2.charAt(s1.length()-i-1))
				{
					char c = s1.charAt(i);
					if(c != 'H' && c != 'I' && c != 'A' && c != 'M' &&c != 'o' && c != 'O' && c != 'x' &&
							c != 'X' && c != 'T' &&c != 'U' &&c != 'V' && c != 'v' && c != 'W' &&c != 'w' &&
							c != 'Y'){
						flag = false;
						break;
						
					}
					
					
				}else{
					char c1 = s1.charAt(i);
					char c2 = s2.charAt(s1.length()-i-1);
					
					if((c1 == 'b' && c2 == 'd') ||(c2 == 'b' && c1 == 'd') ||(c1 == 'n' && c2 == 'u')||(c1 == 'u' && c2 == 'n')||
							(c1 == 'p' && c2 == 'q')||(c1 == 'q' && c2 == 'p'))
						continue;
					else
					{	flag = false;
						break;
					
					}
					
				}
			}
			
			if(flag)
				System.out.println("TAK");
			else
				System.out.println("NIE");
			
			
			
			
			
			
			
		
			
			
	
			
		
		
	}
}