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.*;
import java.util.*;
import java.math.*;
import static java.lang.Math.*;
import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.Double.parseDouble;
import static java.lang.String.*;

public class Main {
    
    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder out = new StringBuilder();
        StringTokenizer tk;

        Map<Character,Character> mir = new HashMap<>();
        
        mir.put('A','A');
        mir.put('H','H');
        mir.put('I','I');
        mir.put('M','M');
        mir.put('O','O');
        mir.put('T','T');
        mir.put('U','U');
        mir.put('V','V');
        mir.put('W','W');
        mir.put('X','X');
        mir.put('Y','Y');
        
        mir.put('b','d');
        mir.put('d','b');
        mir.put('q','p');
        mir.put('p','q');
        mir.put('o','o');
        mir.put('v','v');
        mir.put('w','w');
        mir.put('x','x');
        
        String s = in.readLine();
        
        boolean f = true;
        
        for(int i=0; i<s.length()/2; i++) {
            if(!mir.containsKey(s.charAt(i)) || mir.get(s.charAt(i))!=s.charAt(s.length()-1-i)) {
                f = false;
                break;
            }
        }
        
        if(f && s.length()%2==1) {
            if(!mir.containsKey(s.charAt(s.length()/2)) || mir.get(s.charAt(s.length()/2))!=s.charAt(s.length()/2))
                f = false;
        }
        
        System.out.println(f ? "TAK" : "NIE");
    }
    
}