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.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

/**
 * Created by maxormo on 7/15/2016.
 */
public class e14b {

    static Set<Character> symmetric
            = new HashSet<>(Arrays.asList('A', 'I', 'H', 'M', 'O', 'o', 'T', 'U', 'V', 'v', 'W', 'w', 'X', 'x', 'Y'));

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.nextLine();

        if (s.length() == 1) {
            if (symmetric.contains(s.charAt(0))) {
                System.out.println("TAK");
            } else {
                System.out.println("NIE");
            }
            return;
        }

        for (int i = 0; i < s.length() / 2; i++) {
            int last = s.length() - i - 1;
            if (!symmetric_equals(s.charAt(i), s.charAt(last))) {
                System.out.println("NIE");
                return;
            }
        }

        if (s.length() % 2 != 0) {
            if (symmetric.contains(s.charAt(s.length() / 2))) {
                System.out.println("TAK");
            } else {
                System.out.println("NIE");
            }
            return;
        }
        System.out.println("TAK");
    }

    static boolean symmetric_equals(char a, char b) {

        if (a == 'b' && b == 'd' || a == 'd' && b == 'b' || a == 'p' && b == 'q' || a == 'q' && b == 'p') {
            return true;
        } else if (a == b && symmetric.contains(a)) {
            return true;
        }
        return false;
    }
}