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.*;

/**
 * Created by Администратор on 14.07.2016.
 */
public class SPalindrom {
    static Map<String,String> code;
    public  static  void main(String args[]){
        Scanner in=new Scanner(System.in);
        String str=in.next();
        makeKeys();
        int length=str.length();
        boolean isP=true;

        for (int i=0;i<length/2;i++){
            String c1=""+str.charAt(i);
            String c2=""+str.charAt(length-1-i);
            String expc2=code.get(c1);
            if(expc2!=null&&expc2.equals(c2)){
                //do nothing
            }else{
                isP=false;
                break;
            }
        }

        isP=isP&&checkTheCenter(str);

        if(isP){
            System.out.print("TAK");
        }else {
            System.out.print("NIE");
        }
        return;
    }

    private static boolean checkTheCenter(String str) {
        int len=str.length();
        if(len%2==0){
            return true;
        }else{
            char c=str.charAt(len/2);
            char centrs[]={'A','H','I','M','O','o','T','U','V','v','W','w','X','x','Y'};
            for(int i=0;i<centrs.length;i++){
                if(c==centrs[i]){
                    return true;
                }
            }
            return false;
        }
    }

    public static void makeKeys(){
        code=new HashMap<String, String>();
        code.put("d","b");
        code.put("b","d");
        code.put("A","A");
        code.put("H","H");
        code.put("I","I");
        code.put("M","M");
        code.put("O","O");
        code.put("o","o");
        code.put("p","q");
        code.put("q","p");
        code.put("T","T");
        code.put("U","U");
        code.put("v","v");
        code.put("V","V");
        code.put("W","W");
        code.put("w","w");
        code.put("x","x");
        code.put("X","X");
        code.put("Y","Y");
    }
}