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.Scanner;

/**
 * Created on 13.07.2016.
 */
public class task2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.nextLine();
        String mirch = "AHIMOoTUVvWwXxY";
        int len=s.length();
        int k=len/2+len%2;
        String rez="TAK";
        while(k>0) {
            if ((k - 1 == len - k) && mirch.indexOf(s.charAt(k-1))<0){
                rez="NIE";
                break;
            }
            if (k - 1 != len - k){
                if(mirch.indexOf(s.charAt(k-1))<0&&!(s.charAt(k-1)=='b'&&s.charAt(len-k)=='d')&&!(s.charAt(k-1)=='p'&&s.charAt(len-k)=='q')
                        &&!(s.charAt(k-1)=='d'&&s.charAt(len-k)=='b')&&!(s.charAt(k-1)=='q'&&s.charAt(len-k)=='p')) {
                    rez = "NIE";
                    break;
                }
                if (mirch.indexOf(s.charAt(k-1))>=0&&s.charAt(k-1)!=s.charAt(len-k)) {
                    rez = "NIE";
                    break;
                }
            }
            k--;
        }
        System.out.println(rez);
    }
}