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.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.HashMap;

public class New4 {
    public static void main(String[] args) throws Exception {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
        String s = in.readLine();
        int flag=0;
        int n=s.length();
        HashMap<Character, Character> map = new HashMap<>();
        for (int i='A'; i<='Z'; i++) {
            if (i=='A' || i=='H' || i=='I' || i=='M' || i=='O' || i=='T' || i=='U' || i=='V' || i=='W' || i=='X' || i=='Y') {
                map.put((char)i, (char)i);
            }
        }
        map.put('b', 'd');
        map.put('d', 'b');
        map.put('p', 'q');
        map.put('q', 'p');
        for (int i='a'; i<='z'; i++) {
            
            if (i=='o' || i=='v' || i=='w' || i=='x') {
                map.put((char)i, (char)i);
            }
        }
        for (int i=0; i<=((n-1)/2); i++) {
            if (!map.containsKey(s.charAt(i))) {
                flag=1;
                break;
            }
            else {
                if (s.charAt(n-1-i)!=map.get(s.charAt(i))) {
                    flag=1;
                    break;
                }
            }
        }
        if (flag==0) {
            out.write("TAK\n");
        }
        else {
            out.write("NIE\n");
        }
        out.flush();
    }
    
    private static int ip (String s) {
        int n = Integer.parseInt(s);
        return n;
    }
    
    private static long lp (String s) {
        long n = Long.parseLong(s);
        return n;
    }
    
    private static double dp (String s) {
        double n = Double.parseDouble(s);
        return n;
    }
    
    private static int[] ia (String s, int n) {
        String[] s1 = s.split(" ");
        int[] A = new int[n];
        for (int i=0; i<n; i++) {
            A[i] = Integer.parseInt(s1[i]);
        }
        return A;
    }
    
    private static long[] la (String s, int n) {
        String[] s1 = s.split(" ");
        long[] A = new long[n];
        for (int i=0; i<n; i++) {
            A[i] = Long.parseLong(s1[i]);
        }
        return A;
    }
    
    private static double[] da (String s, int n) {
        String[] s1 = s.split(" ");
        double[] A = new double[n];
        for (int i=0; i<n; i++) {
            A[i] = Double.parseDouble(s1[i]);
        }
        return A;
    }

}