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.*;
import java.io.*;
public class Main {
static ArrayList<Integer>list[];
public static void main(String [] args)throws Exception{
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	//StringTokenizer st = new StringTokenizer(br.readLine());
	String str = br.readLine();
	Character[] set = new Character[]{'A','H','I','M','O','T','U','V','W','X','Y'};
	Character[] smallset = new Character[]{'o','v','w','x'};
	HashSet<Integer>hash = new HashSet<Integer>();
	boolean flag = true;
	for(int i = 0;i < set.length;i++)
		hash.add(set[i] - 'A');
	for(int i = 0;i < smallset.length;i++)
		hash.add(smallset[i] - 'A');
	int n = str.length();
	if(n % 2 == 1 && !hash.contains(str.charAt(n/2) - 'A'))
		flag = false;
		//System.out.println(flag);
    for(int i = n/2 - 1;i >= 0;i--){
    	if(!(str.charAt(i) == str.charAt(n - i - 1) && hash.contains(str.charAt(i) - 'A') ||
    		str.charAt(i) == 'p' && str.charAt(n - i - 1) == 'q' || str.charAt(i) == 'q' && str.charAt(n - i - 1) == 'p'
    		|| str.charAt(i) == 'b' && str.charAt(n - i - 1) == 'd' || str.charAt(i) == 'd' && str.charAt(n - i - 1) == 'b'))
    		flag = false;
    	//if(!flag)System.out.println(i + " " + str.charAt(i) + " " + str.charAt(n - i - 1));
    }
    if(!flag)System.out.print("NIE");
    else System.out.println("TAK");
}
}