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.util.*;

public class ProblemB {

    static InputReader in = new InputReader(System.in);

    public static void main(String[] args) {
        String s = in.next();
        char[] s1 = s.substring(0, s.length() / 2).toCharArray();
        char[] s2 = s.substring(s.length() / 2, s.length()).toCharArray();
        Set<Character> zerkal = new HashSet<>();
        zerkal.add('X');
        zerkal.add('x');
        zerkal.add('O');
        zerkal.add('o');
        zerkal.add('H');
        zerkal.add('M');
        zerkal.add('T');
        zerkal.add('U');
        zerkal.add('V');
        zerkal.add('v');
        zerkal.add('W');
        zerkal.add('w');
        zerkal.add('Y');
        zerkal.add('A');
        zerkal.add('I');
        if (s.length() == 1 && !zerkal.contains(s.charAt(0))) {
            System.out.println("NIE");
            System.exit(0);
        }
        for (int i = 0; i < s1.length; i++) {
            char c1 = s1[i];
            char c2 = s2[s2.length - 1 - i];
            if (c1 != c2) {
                if (c1 == 'b' && c2 == 'd') {
                    continue;
                }
                if (c2 == 'b' && c1 == 'd') {
                    continue;
                }
                if (c2 == 'p' && c1 == 'q') {
                    continue;
                }
                if (c1 == 'p' && c2 == 'q') {
                    continue;
                }
                System.out.println("NIE");
                System.exit(0);
            }
            if (zerkal.contains(c1)) {
                continue;
            }
            System.out.println("NIE");
            System.exit(0);
        }
        if (s.length() % 2 != 0 && !zerkal.contains(s.charAt(s.length() / 2))) {
            System.out.println("NIE");
        } else {
            System.out.println("TAK");
        }
    }


    private static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;

        InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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