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.*;
import java.math.BigInteger;
import java.util.*;

public class CodeForces {
    public static void main(String[] args) throws FileNotFoundException {
        InputReader inputReader = new InputReader(System.in);
        PrintWriter printWriter = new PrintWriter(System.out, true);

        String s = inputReader.readLine();
        boolean isPol = true;

        Map<Character, Character> mirrorMap = new HashMap<>();
        mirrorMap.put('A', 'A');
        mirrorMap.put('b', 'd');
        mirrorMap.put('d', 'b');
        mirrorMap.put('H', 'H');
        mirrorMap.put('I', 'I');
        mirrorMap.put('M', 'M');
        mirrorMap.put('O', 'O');
        mirrorMap.put('o', 'o');
        mirrorMap.put('p', 'q');
        mirrorMap.put('q', 'p');
        mirrorMap.put('T', 'T');
        mirrorMap.put('U', 'U');
        mirrorMap.put('V', 'V');
        mirrorMap.put('v', 'v');
        mirrorMap.put('W', 'W');
        mirrorMap.put('w', 'w');
        mirrorMap.put('X', 'X');
        mirrorMap.put('x', 'x');
        mirrorMap.put('Y', 'Y');
        for (int i = 0; i <= s.length() / 2; i++) {
            if (!mirrorMap.keySet().contains(s.charAt(i))
                    || s.charAt(s.length() - i - 1) != mirrorMap.get(s.charAt(i))) {
                isPol = false;
                break;
            }
        }

        printWriter.print(isPol ? "TAK" : "NIE");

        printWriter.close();
    }

    private static void shuffleArray(int[] a) {
        Random r = new Random();
        int tmp;
        for (int i = 1; i < a.length; i++) {
            tmp = r.nextInt(i + 1);
            int val = a[tmp];
            a[tmp] = a[i];
            a[i] = val;
        }
    }

    private static class InputReader {
        private final BufferedReader reader;
        private StringTokenizer tokenizer;

        public InputReader(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
        }

        public int[] nextIntArray(int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; ++i) {
                array[i] = nextInt();
            }
            return array;
        }

        public long[] nextLongArray(int size) {
            long[] array = new long[size];
            for (int i = 0; i < size; ++i) {
                array[i] = nextLong();
            }
            return array;
        }

        public double[] nextDoubleArray(int size) {
            double[] array = new double[size];
            for (int i = 0; i < size; ++i) {
                array[i] = nextDouble();
            }
            return array;
        }

        public String[] nextStringArray(int size) {
            String[] array = new String[size];
            for (int i = 0; i < size; ++i) {
                array[i] = next();
            }
            return array;
        }

        public boolean[][] nextBooleanTable(int rows, int columns, char trueCharacter) {
            boolean[][] table = new boolean[rows][columns];
            for (int i = 0; i < rows; ++i) {
                String row = next();
                assert row.length() == columns;
                for (int j = 0; j < columns; ++j) {
                    table[i][j] = (row.charAt(j) == trueCharacter);
                }
            }
            return table;
        }

        public char[][] nextCharTable(int rows, int columns) {
            char[][] table = new char[rows][];
            for (int i = 0; i < rows; ++i) {
                table[i] = next().toCharArray();
                assert table[i].length == columns;
            }
            return table;
        }

        public int[][] nextIntTable(int rows, int columns) {
            int[][] table = new int[rows][columns];
            for (int i = 0; i < rows; i++) {
                for (int j = 0; j < columns; j++) {
                    table[i][j] = nextInt();
                }
            }
            return table;
        }

        public long[][] nextLongTable(int rows, int columns) {
            long[][] table = new long[rows][columns];
            for (int i = 0; i < rows; i++) {
                for (int j = 0; j < columns; j++) {
                    table[i][j] = nextLong();
                }
            }
            return table;
        }

        public double[][] nextDoubleTable(int rows, int columns) {
            double[][] table = new double[rows][columns];
            for (int i = 0; i < rows; i++) {
                for (int j = 0; j < columns; j++) {
                    table[i][j] = nextDouble();
                }
            }
            return table;
        }

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

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

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

        public BigInteger nextBigInteger() {
            return new BigInteger(next());
        }

        public boolean hasNext() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                String line = readLine();
                if (line == null) {
                    return false;
                }
                tokenizer = new StringTokenizer(line);
            }
            return true;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                tokenizer = new StringTokenizer(readLine());
            }
            return tokenizer.nextToken();
        }

        public String readLine() {
            String line;
            try {
                line = reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            return line;
        }
    }
}