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.lang.reflect.Array;
import java.util.*;
import java.io.IOException;
import java.io.InputStream;
import java.util.stream.Collector;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;


public class Main {
    public static void main(String[] args) {

        File file = new File("in.txt");
        InputStream inputStream = null;
//        try {inputStream= new FileInputStream(file);} catch (FileNotFoundException ex){return;};
        inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }
}





class TaskB {

    public void solve(int testNumber, InputReader in, PrintWriter out) {

        String word = in.next();

        Boolean res = Boolean.TRUE;


        Set<String> goodLetters = Stream.of("A","H","I","M","O","o","T","U","V","v","W","w","X","x","Y").collect(Collectors.toSet());
        Map<String,String> pairs = new HashMap<>();
        pairs.put("b","d");
        pairs.put("d","b");
        pairs.put("p","q");
        pairs.put("q","p");



        int len = word.length();
        if( len % 2 == 1){
            String middle = word.substring(len /2 , len /2 +1);
            if(!goodLetters.contains(middle)){
                out.println("NIE");
                return;
            }
        }



        for(int i=0;i<len/2;i++){
            String front = word.substring(i,i+1);
            String back = word.substring(len-i-1,len-i);
            if(pairs.keySet().contains(front)){
                if(!back.equals(pairs.get(front))) {
                    out.println("NIE");
                    return;
                }
            }
            else if(!goodLetters.contains(front)){
                out.println("NIE");
                return;
            }

            else if(!front.equals(back)){
                out.println("NIE");
                return;
            }
        }

        out.println("TAK");




    }



}







class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream), 32768);
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public String nextLine(){
        try {
            return reader.readLine();
        } catch (IOException e){
            throw new RuntimeException(e);
        }
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }
    public long nextLong() { return Long.parseLong(next()); }

}



class Pair<F, S> {
    public final F first;
    public final S second;




    public Pair(F first, S second) {
        this.first = first;
        this.second = second;
    }

    @Override
    public boolean equals(Object o) {
        if (!(o instanceof Pair)) {
            return false;
        }
        Pair<?, ?> p = (Pair<?, ?>) o;
        return Objects.equals(p.first, first) && Objects.equals(p.second, second);
    }

    @Override
    public int hashCode() {
        return (first == null ? 0 : first.hashCode()) ^ (second == null ? 0 : second.hashCode());
    }

    @Override
    public String toString() {
        return "(" + first + ", " + second + ')';
    }
}