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 Ultimo {
	
    public static void main(String[] args) {
    	Scanner in = new Scanner(System.in);
    	boolean r = true;
    	String s = in.next();
    	int m = s.length() / 2 - 1;
    	
    	if(s.length() % 2 != 0)
    	{
    		if(s.charAt(m + 1) != 'A' && s.charAt(m + 1) != 'H' && s.charAt(m + 1) != 'I' && s.charAt(m + 1) != 'M' && s.charAt(m + 1) != 'O' && s.charAt(m + 1) != 'o' && s.charAt(m + 1) != 'T' && s.charAt(m + 1) != 'U' && s.charAt(m + 1) != 'V' && s.charAt(m + 1) != 'v' && s.charAt(m + 1) != 'W' && s.charAt(m + 1) != 'w' && s.charAt(m + 1) != 'X' && s.charAt(m + 1) != 'x' && s.charAt(m + 1) != 'Y')
    			r = false;
    	}
    	//System.out.println(r);
    	if(r)
    	{
    		int k = s.length() / 2 + s.length() % 2;
    		for(int j = m; j >= 0; j --, k ++)
    		{
    			//System.out.println(j + " " + k);
    			if(s.charAt(j) == s.charAt(k))
    			{
    				if(s.charAt(j) != 'A' && s.charAt(j) != 'H' && s.charAt(j) != 'I' && s.charAt(j) != 'M' && s.charAt(j) != 'O' && s.charAt(j) != 'o' && s.charAt(j) != 'T' && s.charAt(j) != 'U' && s.charAt(j) != 'V' && s.charAt(j) != 'v' && s.charAt(j) != 'W' && s.charAt(j) != 'w' && s.charAt(j) != 'X' && s.charAt(j) != 'x' && s.charAt(j) != 'Y')
    				{
    					r = false;
    				}
    			}else
    			{
    				if(s.charAt(j) == 'b')
    				{
    					if(s.charAt(k) != 'd')
    						r = false;
    				}else if(s.charAt(j) == 'd')
    				{
    					if(s.charAt(k) != 'b')
    						r = false;
    				}else if(s.charAt(j) == 'p')
    				{
    					if(s.charAt(k) != 'q')
    						r = false;
    				}else if(s.charAt(j) == 'q')
    				{
    					if(s.charAt(k) != 'p')
    						r = false;
    				}else
    				{
    					r = false;
    				}
    			}
    		}
    	}
    	
    	System.out.println(r ? "TAK" : "NIE");
    }
}