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.InputStreamReader;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.HashSet;
/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Erasyl Abenov
 * 
 * 
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
            try (PrintWriter out = new PrintWriter(outputStream)) {
                TaskB solver = new TaskB();
                solver.solve(1, in, out);
            }
    }
}
class TaskB {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
        char c[] = in.next().toCharArray();
        if (c.length%2 == 1) {
            if (!check(c[c.length/2], c[c.length/2])) {
                out.println("NIE");
                return;
            }
        }
        for (int i = 0; i < c.length/2; ++i) {
            if (!check(c[i], c[c.length - i - 1])) {
                out.println("NIE");
                return;
            }
        }
        out.println("TAK");
    }
    boolean check (char a, char b) {
        return a == 'A' && b == 'A'|| a == 'b' && b == 'd' || a == 'd' && b == 'b' 
                || a == 'H' && b == 'H' || a == 'I' && b == 'I' 
                || a == 'M' && b == 'M' || a == 'O' && b == 'O' || a == 'o' && b == 'o' 
                || a == 'p' && b == 'q' || a == 'q' && b == 'p' || a == 'T' && b == 'T'
                || a == 'U' && b == 'U' || a == 'V' && b == 'V' || a == 'v' && b == 'v'
                || a == 'W' && b == 'W' || a == 'w' && b == 'w' || a == 'X' && b == 'X'
                || a == 'x' && b == 'x' || a == 'Y' && b == 'Y';
    }
}
     
class InputReader {
    private final BufferedReader reader;
    private StringTokenizer tokenizer;
    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }
      
    public String nextLine() {
        try {
            return reader.readLine();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
      
    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(nextLine());
        }
        return tokenizer.nextToken();
    }
      
    public int nextInt() {
        return Integer.parseInt(next());
    }
    public long nextLong() {
        return Long.parseLong(next());
    }
    public double nextDouble() {
        return Double.parseDouble(next());
    }
    public BigInteger nextBigInteger() {
        return new BigInteger(next());
    }
}