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

public class B {

	private static final char[][] mirr = { { 'b', 'd' }, { 'd', 'b' }, { 'p', 'q' }, { 'q', 'p' } };
	private static final char[] symm = { 'A', 'H', 'I', 'M', 'O', 'o', 'T', 'U', 'V', 'v', 'W', 'w', 'X', 'x', 'Y' };

	public static void main(String[] args) {
		try (Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)))) {
			System.out.println(solve(in.nextLine()));
		}
	}

	private static String solve(String s) {
		final int n = s.length(), m = n / 2;
		for (int i = 0; i < m; i++) {
			boolean sp = false;
			for (int j = 0; j < symm.length; j++) {
				if (s.charAt(i) == symm[j] && s.charAt(i) == s.charAt(n - 1 - i)) {
					sp = true;
				}
			}
			for (int j = 0; j < mirr.length; j++) {
				if (s.charAt(i) == mirr[j][0] && s.charAt(n - 1 - i) == mirr[j][1]) {
					sp = true;
				}
			}
			if (!sp) {
				return "NIE";
			}
		}
		if (n % 2 == 1) {
			boolean sp = false;
			for (int j = 0; j < symm.length; j++) {
				if (s.charAt(m) == symm[j]) {
					sp = true;
				}
			}
			if (!sp) {
				return "NIE";
			}
		}
		return "TAK";
	}

}