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.InputStream;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.StringTokenizer;

public class B {

	static boolean check(char a, char b) {
		return (a == 'b' && b == 'd') || (a == 'A' && b == 'A') || (a == 'd' && b == 'b') || (a == 'H' && b == 'H')
				|| (a == 'I' && b == 'I') || (a == 'M' && b == 'M') || (a == 'O' && b == 'O') || (a == 'o' && b == 'o')
				|| (a == 'T' && b == 'T') || (a == 'U' && b == 'U') || (a == b && a == 'V') || (a == b && a == 'v')
				|| (a == b && a == 'w') || (a == b && a == 'W') || (a == b && a == 'x') || (a == b && b == 'X')
				|| (a == b && a == 'Y') || (a == 'p' && b == 'q') || (a == 'q' && b == 'p');
	}

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		if (s.length() == 1) {
			if (check(s.charAt(0), s.charAt(0)))
				System.out.println("TAK");
			else
				System.out.println("NIE");
			return;
		}
		for (int i = 0; i < s.length() / 2; i++) {
			if (!check(s.charAt(i), s.charAt(s.length() - 1 - i))) {
				System.out.println("NIE");
				return;
			}
		}
		if (s.length() % 2 != 0)
			if (check(s.charAt((s.length() / 2)), s.charAt((s.length() / 2))))
				System.out.println("TAK");
			else
				System.out.println("NIE");
		else
			System.out.println("TAK");
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

	}
}