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.*;
import java.io.*;

public class Problem691B
{
    public static void main(String[] args) throws IOException
    {
        BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
        String s = f.readLine();

        HashMap<Character, Character> table = new HashMap<Character, Character>();
        table.put('A', 'A');
        table.put('b', 'd');
        table.put('d', 'b');
        table.put('H', 'H');
        table.put('I', 'I');
        table.put('M', 'M');
        table.put('O', 'O');
        table.put('o', 'o');
        table.put('p', 'q');
        table.put('q', 'p');
        table.put('T', 'T');
        table.put('U', 'U');
        table.put('V', 'V');
        table.put('v', 'v');
        table.put('W', 'W');
        table.put('w', 'w');
        table.put('X', 'X');
        table.put('x', 'x');
        table.put('Y', 'Y');

        if (s.length() == 1)
        {
            char c = s.charAt(0);
            if (!table.containsKey(c) || table.get(c) != c)
            {
                System.out.println("NIE");
            }
            else
            {
                System.out.println("TAK");
            }
            System.exit(0);
        }

        String first, after;

        if (s.length() % 2 == 0)
        {
            first = s.substring(0, s.length() / 2);
            after = s.substring(s.length() / 2, s.length());
        }
        else
        {
            first = s.substring(0, s.length() / 2);
            after = s.substring(s.length () / 2 + 1, s.length());
            char c = s.charAt(s.length() / 2);
            if (!table.containsKey(c) || table.get(c) != c)
            {
                System.out.println("NIE");
                System.exit(0);
            }
        }

        for (int i = 0; i < first.length(); i++)
        {
            char c = first.charAt(i);
            if (!table.containsKey(c) || (table.get(c) != after.charAt(after.length() - 1 - i)))
            {
                System.out.println("NIE");
                System.exit(0);
            }
        }
        System.out.println("TAK");
        System.exit(0);

    }
}