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

/* Name of the class has to be "Main" only if the class is public*/
public class  spalin
{
    static class FastReader {
        
        BufferedReader br;
        StringTokenizer st;
        
        public FastReader() {
            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();
        }
        
        int 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;
        }
    }
    
    static class Node {
        
        long pp;
        long a, b;
        
        Node(long x, long y) {
            a = x;
            b = y;
            pp = a * b;
        }
    }
    static class Comp implements Comparator<Node> {
        
        public int compare(Node o1, Node o2) {
            if (o1.pp > o2.pp) {
                return 1;
            } else {
                return -1;
            }
        }
    }
    public static void main(String[] args) {
        FastReader sc=new FastReader();
        PrintWriter out=new PrintWriter(System.out);
        //your code starts here
        char s[]=sc.next().toCharArray();
        String mid="AHIMOTUVWXYovwx";
        int l=s.length;
        if(l==1){
            if(mid.indexOf(s[0])!=-1)
            System.out.println("TAK");
            else System.out.println("NIE");
            return;
        }
        if((l&1)==1) {
            if(mid.indexOf(s[l/2])==-1)
            {
                System.out.println("NIE");
                return;
            }
            out.println(solver((l/2)-1,(l/2)+1,mid,s));
        }
        else out.println(solver((l/2)-1,l/2,mid,s));
        
        out.close();
    }
    static String solver(int i, int j, String mid, char s[])
    {
        int flag=1;
        while(i>=0) {
            if((mid.indexOf(s[i])==mid.indexOf(s[j]) && mid.indexOf(s[i])!=-1) 
            || (s[i]=='b' && s[j]=='d') || (s[i]=='d' && s[j]=='b') 
            || (s[i]=='p' && s[j]=='q') || (s[i]=='q' && s[j]=='p')){
                i--;j++;continue;
            }
            else {
                flag=0; break;
            }
        }
        if(flag==0) return "NIE"; else return "TAK";
    }
}