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.*;
import java.util.*;
public class CFEdu14B
{
	public static final int MOD = (int) (1e9 + 7);
	private static int[] nextIntArray(InputReader in,int n)	
	{
		int[] a=new int[n];
		for(int i=0;i<n;i++)
			a[i]=in.nextInt();
		return a;
	}
	private static void show(int[] a)
	{
		for(int i=0;i<a.length;i++)
			System.out.print(a[i]+" ");
		System.out.println();
	}
	private static void show2DArray(char[][] a)
	{
		for(int i=0;i<a.length;i++)
		{
			for(int j=0;j<a[0].length;j++)
				System.out.print(a[i][j]);
			System.out.println();
		}
	}
	static class Pair
	{
		private int first;
		private int second;
		public Pair(int i, int j) 
		{ 
			this.first = i;
			this.second = j;
		}
		public int getFirst() { return first; }
		public int getSecond() { return second ;}
		public void setFirst(int k) { this.first=k ; }
		public void setSecond(int k) { this.second=k ;}
	}
	private static boolean isPalindrome(String s)
	{
		int i=0,n=s.length(),j=n-1;
		for(;i<j;i++,j--)
		{
			if(s.charAt(i)!=s.charAt(j))
			{
				if((s.charAt(i)=='p' && s.charAt(j)=='q') || (s.charAt(i)=='q' && s.charAt(j)=='p') || (s.charAt(i)=='b' && s.charAt(j)=='d') || (s.charAt(i)=='d' && s.charAt(j)=='b')) 
					continue;
				else
					return false;
			}
		}
		return true;
	}
	public static void main(String args[])
	{
		InputReader in = new InputReader(System.in);
		OutputStream outputStream = System.out;
		PrintWriter out = new PrintWriter(outputStream);
		/*------------------------------My Code starts here------------------------------*/
		String s=in.next(),t="AHIMOoTUVvWwXxY";
		Set<Character> st=new HashSet<>();
		int i=0,n=s.length();
		for(;i<t.length();i++)
			st.add(t.charAt(i));
		for(i=0;i<n;i++)
		{
			if(!st.contains(s.charAt(i)))
			{
				if((s.charAt(i)=='p' && s.charAt(n-i-1)=='q') || (s.charAt(i)=='q' && s.charAt(n-i-1)=='p') || (s.charAt(i)=='b' && s.charAt(n-i-1)=='d') || (s.charAt(i)=='d' && s.charAt(n-i-1)=='b')) 
					continue;
				else
				{
					out.println("NIE");
					out.close();
					return ;
				}
			}
		}
		if(isPalindrome(s))
			out.println("TAK");
		else
			out.println("NIE");
		out.close();
		/*------------------------------The End------------------------------------------*/
	}
	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream inputstream) {
			reader = new BufferedReader(new InputStreamReader(inputstream));
			tokenizer = null;
		}

		public String nextLine(){
			String fullLine=null;
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					fullLine=reader.readLine();
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
				return fullLine;
			}
			return fullLine;
		}
		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}
		public long nextLong() {
			return Long.parseLong(next());
		}
		public int nextInt() {
			return Integer.parseInt(next());
		}
	}
}