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:
//package CodeForces.EducationalRound14;

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

/**
 * Created by ilya on 6/13/16.
 */

public class B691 {


    public static void main(String[] args) {
        sc sc = new sc();
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
        String a = sc.next();
        for (int i = 0; i < a.length()/2; i++) {
            if (a.charAt(i) == 'b' && a.charAt(a.length()-1-i) == 'd') continue;
            else if (a.charAt(i) == 'd' && a.charAt(a.length()-1-i) == 'b') continue;
            else if (a.charAt(i) == 'p' && a.charAt(a.length()-1-i) == 'q') continue;
            else if (a.charAt(i) == 'q' && a.charAt(a.length()-1-i) == 'p') continue;
            else if ((a.charAt(i)=='o' ||
                    a.charAt(i)=='O' ||
                    a.charAt(i)=='A' ||
                    a.charAt(i)=='X' ||
                    a.charAt(i)=='x' ||
                    a.charAt(i)=='H' ||
                    a.charAt(i)=='I' ||
                    a.charAt(i)=='M' ||
                    a.charAt(i)=='T' ||
                    a.charAt(i)=='U' ||
                    a.charAt(i)=='V' ||
                    a.charAt(i)=='v' ||
                    a.charAt(i)=='W' ||
                    a.charAt(i)=='w' ||
                    a.charAt(i)=='Y') && a.charAt(i) == a.charAt(a.length()-1-i))continue;
            else {
                out.println("NIE");
                out.close();
                return;
            }
        }
        if (a.length()%2 == 0){
            out.println("TAK");
            out.close();
            return;

        }else if (a.charAt(a.length()/2)=='o' ||
                a.charAt(a.length()/2)=='O' ||
                a.charAt(a.length()/2)=='A' ||
                a.charAt(a.length()/2)=='X' ||
                a.charAt(a.length()/2)=='x' ||
                a.charAt(a.length()/2)=='H' ||
                a.charAt(a.length()/2)=='I' ||
                a.charAt(a.length()/2)=='M' ||
                a.charAt(a.length()/2)=='T' ||
                a.charAt(a.length()/2)=='U' ||
                a.charAt(a.length()/2)=='V' ||
                a.charAt(a.length()/2)=='v' ||
                a.charAt(a.length()/2)=='W' ||
                a.charAt(a.length()/2)=='w' ||
                a.charAt(a.length()/2)=='Y') {
            out.println("TAK");
        }
        else out.println("NIE");
        out.close();
    }

    public static class sc {
        BufferedReader br;
        StringTokenizer st;

        public sc() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

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

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

}