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.OutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.StringTokenizer;



public class Problem2 {
	

	static long n, m;
	public static void main(String[] args){
		// TODO Auto-generated method stub
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		HashMap<Character, Character> mir = new HashMap<>();
		mir.put('x', 'x');
		mir.put('A', 'A');
		mir.put('X', 'X');
		mir.put('T', 'T');
		mir.put('U', 'U');
		mir.put('V', 'V');
		mir.put('v', 'v');
		mir.put('W', 'W');
		mir.put('w', 'w');
		mir.put('Y', 'Y');
		mir.put('o', 'o');
		mir.put('O', 'O');
		mir.put('I', 'I');
		mir.put('b', 'd');
		mir.put('d', 'b');
		mir.put('M', 'M');
		mir.put('H', 'H');
		mir.put('q', 'p');
		mir.put('p', 'q');
		String s = in.next();
		int len = s.length();
		if(len == 1)
		{
			if(mir.containsKey(s.charAt(0)))
			{
				out.println("TAK");
			}
			else
			{
				out.println("NIE");
			}
			out.close();
			return;
		}
		int cen;
		int beg;
		if(len%2 == 0)
		{
			cen = len/2;
			beg = cen - 1;
		}
		else
		{
			cen = len/2 + 1;
			beg = cen-2;
			if(!mir.containsKey(s.charAt(cen-1)))
			{
				out.println("NIE");
				out.close();
				return;
			}
			else if(s.charAt(cen-1) =='b' || s.charAt(cen-1) == 'd' || s.charAt(cen-1) =='q' || s.charAt(cen-1) == 'p')
			{
				out.println("NIE");
				out.close();
				return;
			}
			
		}
		
		for(int i = cen; i < len; ++i )
		{
			if(!mir.containsKey(s.charAt(beg)))
			{
				out.println("NIE");
				out.close();
				return;
			}
			
			if(s.charAt(i) != mir.get(s.charAt(beg)))
			{
				out.println("NIE");
				out.close();
				return;
			}
			--beg;
		}
		out.println("TAK");
		out.close();

	}
	

	
	
	


	
	static class InputReader {
	    public BufferedReader reader;
	    public StringTokenizer tokenizer;

	    public InputReader(InputStream stream) {
	        reader = new BufferedReader(new InputStreamReader(stream), 32768);
	        tokenizer = null;
	    }

	    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 int nextInt() {
	        return Integer.parseInt(next());
	    }
	    
	    public long nextLong()
	    {
	    	return Long.parseLong(next());
	    }

	}


}