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


public class ABC {

	static TreeSet<Character> mirror;
	public static void main(String[] args) throws IOException{
		
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out); 
		String s = sc.nextLine();
		fillMirror();
		int i = 0, j = s.length()-1;
		boolean not = false;
		while(i < j)
		{
			char c1 = s.charAt(i), c2 = s.charAt(j);
			if(c1 == c2 && mirror.contains(c1))
			{	
				i++; j--;
				continue;
			}
			if(c1 == 'p' && c2 == 'q' || c1 == 'q' && c2 == 'p')
			{
				i++; j--;
				continue;
			}
			if(c1 == 'b' && c2 == 'd' || c1 == 'd' && c2 == 'b')
			{	
				i++; j--;
				continue;
			}
			not = true;
			break;
		}
		if(i == j)
		{
			not = !mirror.contains(s.charAt(i));
		}
		out.println(not? "NIE" : "TAK");
		out.flush();
	}

	static void fillMirror()
	{
		mirror = new TreeSet<>();
		mirror.add('A'); mirror.add('H');
		mirror.add('M');mirror.add('I');
		mirror.add('O');mirror.add('o');
		mirror.add('U');mirror.add('T');
		mirror.add('V');mirror.add('v');
		mirror.add('w');mirror.add('W');
		mirror.add('X');mirror.add('x');
		mirror.add('Y');mirror.add('Y');
	}
	
	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
		{
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if(x.charAt(0) == '-')
			{
				neg = true;
				start++;
			}
			for(int i = start; i < x.length(); i++)
				if(x.charAt(i) == '.')
				{
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				}
				else
				{
					sb.append(x.charAt(i));
					if(dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg?-1:1);
	}
		
		public boolean ready() throws IOException {
			return br.ready();
		}
	}

}