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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

public class A {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
      //  int testCount = Integer.parseInt(in.next());
        //for (int i = 1; i <= testCount; i++)
        solver.solve(0, in, out);
        out.close();
    }


    static class TaskA {
        public boolean symmetricLetter(char c) {
            String symmetric = "AHIMOoTUVvWwXxY";
            for (int i = 0; i < symmetric.length(); ++i) {
                if (symmetric.charAt(i) == c) {
                    return true;
                }
            }
            return false;
        }

        public boolean pair(char a, char  b) {
            String pair1 = "bdpq";
            String pair2 = "dbqp";
            for (int i = 0; i < pair1.length(); ++i) {
                if (a == pair1.charAt(i) && b == pair2.charAt(i)) {
                    return true;
                }
            }
            return false;
        }
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            String text = in.nextString();
            int n = text.length();
            for (int i = 0; i < n; ++i) {
                if (text.charAt(i) == text.charAt(n - i - 1)) {
                    if (!symmetricLetter(text.charAt(i))) {
                        out.println("NIE");
                        return;
                    }
                } else {
                    if (!pair(text.charAt(i), text.charAt(n - i - 1))) {
                        out.println("NIE");
                        return;
                    }
                }
            }
            out.println("TAK");
        }

    }

    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 String nextString() {
            return next();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

    }
}