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:
/**
 * Created by 1 on 16.07.15.
 */

import java.io.*;
import java.util.*;


public class CF1 {
    private MyScanner in;
    private PrintWriter out;

    /*
    *  Solution here
    */
    private CF1 solve() {
        String s = in.next();
        int l = s.length();
        int n = s.length() / 2;
        boolean flag = true, flag2 = true;
//
//        if (l%2==1) {
//            char c1 = s.charAt(n);
//
//                if (c1 == 'A' || c1 == 'H' || c1 == 'I' || c1 == 'M' || c1 == 'O' || c1 == 'T' || c1 == 'U' || c1 == 'V'
//                        || c1 == 'W' || c1 == 'X' || c1 == 'Y' || c1 == 'o' || c1 == 'v' || c1 == 'w'
//                        || c1 == 'x') {
//                    flag = true;
//                }
//                flag2 = false;
//        }
//        if (l%2 == 1 && flag || flag2) {
        for (int i = 0; i < n; i++) {
            char c1 = s.charAt(i);
            char c2 = s.charAt(l - i - 1);
            if (c1 == c2) {
                if (c1 == 'A' || c1 == 'H' || c1 == 'I' || c1 == 'M' || c1 == 'O' || c1 == 'T' || c1 == 'U' || c1 == 'V'
                        || c1 == 'W' || c1 == 'X' || c1 == 'Y' || c1 == 'o' || c1 == 'v' || c1 == 'w'
                        || c1 == 'x') {
                    i = i;

                } else {
                    flag = false;
                    break;
                }
            } else if (c1 == 'b' && c2 == 'd' || c1 == 'd' && c2 == 'b' || c1 == 'q' && c2 == 'p' || c1 == 'p' && c2 == 'q') {
                i = i;
            } else {
                flag = false;
                break;
            }

        }
//        }

        if (l % 2 == 1) {
            char c1 = s.charAt(n);

            if (c1 == 'A' || c1 == 'H' || c1 == 'I' || c1 == 'M' || c1 == 'O' || c1 == 'T' || c1 == 'U' || c1 == 'V'
                    || c1 == 'W' || c1 == 'X' || c1 == 'Y' || c1 == 'o' || c1 == 'v' || c1 == 'w'
                    || c1 == 'x') {
            } else {
                flag = false;
            }
        }


        if (flag) {
            out.print("TAK");
        } else {
            out.print("NIE");
        }

        return this;
    }

    private CF1 init() {

        try {
            in = new MyScanner(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        } catch (FileNotFoundException e) {
            throw new RuntimeException();
        }
        return this;
    }

    private CF1 finish() {
        out.flush();
        return this;
    }

    public static void main(String[] args) {
        new CF1().init().solve().finish();
    }

    private static class MyScanner {
        private BufferedReader reader;
        private StringTokenizer tokenizer;
        private boolean hasNextTokenFlag = true;

        MyScanner(final Reader input) throws FileNotFoundException {
            reader = new BufferedReader(input);
            ensureTokenizer();
        }

        MyScanner(final String filename) throws FileNotFoundException {
            this(new FileReader(filename));
        }

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

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

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            if (!hasNextToken()) {
                throw new NoSuchElementException();
            }
            return tokenizer.nextToken("");
        }

        public String next() {
            if (!hasNextToken()) {
                throw new NoSuchElementException();
            }
            return tokenizer.nextToken();
        }

        public boolean hasNextToken() {
            ensureTokenizer();
            return hasNextTokenFlag;
        }

        private void ensureTokenizer() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                String buffer = getBuffer();
                if (buffer == null) {
                    tokenizer = null;
                    hasNextTokenFlag = false;
                    return;
                }
                tokenizer = new StringTokenizer(buffer);
            }
        }

        private String getBuffer() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException();
            }
        }

    }
}