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.awt.*;
import java.io.*;
import java.util.*;

public class Main implements Runnable {

    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");

    void init() throws FileNotFoundException {
        try {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        } catch (Throwable e) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        }
    }

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            try {
                tok = new StringTokenizer(in.readLine());
            } catch (Exception e) {
                return null;
            }
        }
        return tok.nextToken();
    }

    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }

    int[] readIntArray(int size) throws IOException {
        int[] res = new int[size];
        for (int i = 0; i < size; i++) {
            res[i] = readInt();
        }
        return res;
    }

    long readLong() throws IOException {
        return Long.parseLong(readString());
    }

    double readDouble() throws IOException {
        return Double.parseDouble(readString());
    }

    public static void main(String[] args) {
        new Thread(null, new Main(), "", 1l * 200 * 1024 * 1024).start();
    }

    long timeBegin, timeEnd;

    void time() {
        timeEnd = System.currentTimeMillis();
        System.err.println("Time = " + (timeEnd - timeBegin));
    }

    long memoryTotal, memoryFree;

    void memory() {
        memoryFree = Runtime.getRuntime().freeMemory();
        System.err.println("Memory = " + ((memoryTotal - memoryFree) >> 10)
                + " KB");
    }

    public void run() {
        try {
            timeBegin = System.currentTimeMillis();
            memoryTotal = Runtime.getRuntime().freeMemory();
            init();
            solve();
            out.close();
            if (System.getProperty("ONLINE_JUDGE") == null) {
                time();
                memory();
            }
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(-1);
        }
    }
    void solve() throws IOException {
        String s = readString();
        boolean ok = true;
        HashSet<Character> okChars = new HashSet<>();
        okChars.add('A');
        okChars.add('O');
        okChars.add('o');
        okChars.add('X');
        okChars.add('x');
        okChars.add('H');
        okChars.add('I');
        okChars.add('M');
        okChars.add('T');
        okChars.add('U');
        okChars.add('V');
        okChars.add('W');
        okChars.add('v');
        okChars.add('w');
        okChars.add('Y');
        for (int i = 0; i < s.length() / 2; i++) {
            ok = ok && ((s.charAt(i)==s.charAt(s.length()-1-i)&&okChars.contains(s.charAt(i))&&okChars.contains(s.charAt(s.length()-i-1)))||(s.charAt(i)=='b'&&s.charAt(s.length()-1-i)=='d')||(s.charAt(i)=='d'&&s.charAt(s.length()-1-i)=='b')||(s.charAt(i)=='p'&&s.charAt(s.length()-1-i)=='q')||(s.charAt(i)=='q'&&s.charAt(s.length()-1-i)=='p'));
        }
        if (s.length()%2==1){
            ok = ok && okChars.contains(s.charAt(s.length()/2));
        }
        if (ok){
            out.print("TAK");
        }else{
            out.print("NIE");
        }
    }
}