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.*;
import java.io.*;
public class TestClass{
	static PrintWriter out = new PrintWriter(System.out);
	
	public static void main(String args[]) throws Exception
	{
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String s = in.readLine();
		int n = s.length();
		HashMap mp = new HashMap();
		mp.put('A', new Character('A'));
		mp.put('H', new Character('H'));
		mp.put('I', new Character('I'));
		mp.put('M', new Character('M'));
		mp.put('O', new Character('O'));
		mp.put('T', new Character('T'));
		mp.put('U', new Character('U'));
		mp.put('V', new Character('V'));
		mp.put('W', new Character('W'));
		mp.put('X', new Character('X'));
		mp.put('Y', new Character('Y'));
		
		mp.put('b', new Character('d'));
		mp.put('d', new Character('b'));
		mp.put('o', new Character('o'));
		mp.put('p', new Character('q'));
		mp.put('q', new Character('p'));
		//mp.put('u', new Character('u'));
		mp.put('v', new Character('v'));
		mp.put('w', new Character('w'));
		mp.put('x', new Character('x'));
		
		int f=0,g=0;
		if(n%2!=0)
		{
			char c = s.charAt(n/2);
			if(mp.containsKey(c) && c!='b' && c!='d' && c!='p' && c!='q')
			{
				g=1;
			}
		}
		if(g==1 || n%2==0)
		{
			for(int i=0;i<n/2;i++)
			{
				if(mp.containsKey(s.charAt(i)))
				{
					if((char)mp.get(s.charAt(i))!=s.charAt(n-1-i))
					{
						out.println("NIE");
						f=1;
						break;
					}
				}
				else
				{
					out.println("NIE");
					f=1;
					break;
				}
			}
			if(f==0)
			{
				out.println("TAK");
			}
		}
		else
		{
			out.println("NIE");

		}
		out.close();
	}
}