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.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.StringTokenizer;

 public class Test
 {
    static PrintWriter pw = new PrintWriter(System.out);
    
    public static void main(String[] args)throws Exception
    {
        Reader.init(System.in);
        String s = Reader.next();
       
        
        HashSet<Character> set = new HashSet();
        set.add('A');
        set.add('H');
        set.add('I');
        set.add('M');
        set.add('O');
        set.add('T');
        set.add('U');
        set.add('V');
        set.add('W');
        set.add('X');
        set.add('Y');
        set.add('o');
        set.add('w');
        set.add('v');
        set.add('x');
        
        if(s.length() == 1 &&!set.contains(s.charAt(0)))
        {
            pw.print("NIE");
            pw.close();
            return;
        } 
                       
        int L = 0;
        int R = s.length() - 1;
    
        while(L<=R)
        {
            if(L == R)
            {
                if( !set.contains(s.charAt(R)))
                {
                    pw.print("NIE");
                    pw.close();
                    return;
                }
                else
                    break;
            }
            if(s.charAt(R) == s.charAt(L) && !set.contains(s.charAt(L)))
            {
                pw.print("NIE");
                pw.close();
                return;
            }
            else if(s.charAt(R) != s.charAt(L))
            {
                String temp = s.charAt(R) + "" + s.charAt(L);
                if(!temp.equals("pq") && !temp.equals("qp") && !temp.equals("bd") && !temp.equals("db"))
                {
                    pw.print("NIE");
                    pw.close();
                    return;
                }
            }
            
            L++;  R--;
        }
        
        pw.print("TAK");
        pw.close();
   
        
    }
        
}

class Reader {

    static BufferedReader reader;
    static StringTokenizer tokenizer;

    public static int pars(String x) {
        int num = 0;
        int i = 0;
        if (x.charAt(0) == '-') {
            i = 1;
        }
        for (; i < x.length(); i++) {
            num = num * 10 + (x.charAt(i) - '0');
        }

        if (x.charAt(0) == '-') {
            return -num;
        }

        return num;
    }

    static void init(InputStream input) {
        reader = new BufferedReader(
                new InputStreamReader(input));
        tokenizer = new StringTokenizer("");
    }

    static void init(FileReader input) {
        reader = new BufferedReader(input);
        tokenizer = new StringTokenizer("");
    }

    static String next() throws IOException {
        while (!tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(
                    reader.readLine());
        }
        return tokenizer.nextToken();
    }

    static int nextInt() throws IOException {
        return pars(next());
    }

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

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