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.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;

public class Ended {

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		// int n = input.nextInt();
		// int[] buttons = new int[n];
		// for (int i = 0; i < n; i++) {
		// buttons[i] = input.nextInt();
		// }
		String s = input.nextLine();		
		char[] same = {'X' , 'x', 'O', 'o', 'I', 'M', 'H', 'A', 'Y', 'U', 'V', 'v', 'W', 'w', 'T'};
		int len = s.length();
		for (int i = 0, j = s.length() - 1; i < len && j >= 0; i++, j--) {
			char c1 = s.charAt(i);
			char c2 = s.charAt(j);
			if(c1 != c2) {
				if((!(c1 == 'b' && c2 =='d') && !(c1 == 'd' && c2 == 'b'))) {
					if((!(c1 == 'p' && c2 =='q') && !(c1 == 'q' && c2 == 'p'))) {
						System.out.println("NIE");
						return;
					}
				}
			} else {
				boolean found = false;
				for(char cur : same) {
					if(c1 == cur) {
						found = true;
						break;
					}
				}
				if(!found) {
					System.out.println("NIE");
					return;
				}
			}
		}
		System.out.println("TAK");
	}

}