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

public class Codeforces {
    //static InputReader ir = new InputReader(System.in);
    //static OutputWriter ow = new OutputWriter(System.out);

    public static void main(String[] args) throws Exception {
        taskB();
        //taskC();
        exit();
    }

    static boolean isSim(int c) {
        return c == 'H' || c == 'I' || c == 'M' || c == 'o' || c == 'O' || c == 'T' || c == 'U' || c == 'v' || c == 'V' ||
                c =='A' || c == 'W' || c == 'w' || c == 'X' || c == 'x' || c == 'Y';
    }

    static boolean isSim(int l, int r) {
        return (isSim(l) && isSim(r) && l == r) || (l == 'b' && r == 'd') || (l == 'd' && r == 'b')
                || (l == 'p' && r == 'q') || (l == 'q' && r == 'p');
    }

    private static void taskB() throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s = br.readLine();


        if (s.length() % 2 == 1 && !isSim(s.charAt(s.length() / 2))) {
            System.out.print("NIE");
            return;
        }
        for (int i = 0; i < s.length() / 2; ++i) {
            if (!isSim(s.charAt(i), s.charAt(s.length() - 1 - i))) {
                System.out.print("NIE");
                return;
            }
        }
        System.out.print("TAK");
    }

    private static void taskC() throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String num = br.readLine();

        int posT = -1;
        boolean isNull = true;

        for (int i = 0; i < num.length(); ++i) {
            if (num.charAt(i) == '.') {
                posT = i;
            }
            if (num.charAt(i) > '0' && num .charAt(i) <= '9')
                isNull = false;


        }
        if (isNull) {
            System.out.println(0);
            return;
        }

        boolean f = false;
        int l, p, st;
        p = 0;
        if (num.charAt(p) == '.') p += 1;
        for (; p < num.length() && num.charAt(p) == '0'; ++p);
        if (posT == -1) {
            st = num.length() - p - 1;
        } else {
            st = posT - p - 1;
        }
        l = num.length() - 1;
        if (num.charAt(l) == '.') --l;
        for (; l >= 0 && num.charAt(l) == '0'; --l) ;
        //System.out.println(st + " " + p);
        boolean isDataBeforePoint = false;
        for (int i = p + 1; i <= l; ++i) {
            if (num.charAt(i) > '0' && num.charAt(i) <= '9')
                isDataBeforePoint = true;

        }
        for (int i = p; i <= l; ++i) {
            if (num.charAt(i) >= '0' && num.charAt(i) <= '9') {
                if (!f) {
                    f = true;
                    System.out.print(num.charAt(i));
                    if (isDataBeforePoint)
                        System.out.print(".");
                    //if (i + 1 <= l && num.charAt(i + 1) >= '0' && num.charAt(i + 1) <= '9') System.out.print(".");
                    //if (i + 1 <= l) System.out.print(".");
                } else {
                    System.out.print(num.charAt(i));
                }
            }
        }
        if (st != 0) System.out.print("E" + st);
    }

    private static void exit() throws Exception {
        //ir.close();
        //ow.close();
    }
}

class InputReader implements AutoCloseable {
    private final InputStream stream;
    private final int SIZE = 10000;
    private byte[] buffer = new byte[SIZE];
    private int len = 0;
    private int pos = 0;

    InputReader(InputStream stream) {
        this.stream = stream;
    }

    private int read() {
        if (pos >= len) {
            try {
                pos = 0;
                len = stream.read(buffer, 0, SIZE);
                if (len <= 0)
                    return -1;
            } catch (IOException e) {
                throw new InputMismatchException();
            }
        }
        return buffer[pos++];
    }

    private boolean isSpace(int c) {
        return c == ' ' || c == '\n' || c == '\t' || c == '\r' || c == -1;
    }

    private int readSkipSpace() {
        int c;
        do {
            c = read();
        } while (isSpace(c));
        return c;
    }

    int nextInt() {
        int c = readSkipSpace();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res = res * 10 + c - '0';
            c = read();
        } while (!isSpace(c));
        res *= sgn;
        return res;
    }

    String nextLine() {
        String res = "";
        while (true) {
            for (int i = pos; i < len; ++i) {
                if (buffer[i] == '\n') {
                    res += new String(buffer, pos, i - pos);
                    return res;
                }
            }
            try {
                pos = 0;
                len = stream.read(buffer, 0, SIZE);
                if (len <= 0) return res;
            } catch (IOException e) {
                throw new InputMismatchException();
            }
        }
    }


    @Override
    public void close() throws Exception {
        stream.close();
    }
}

class OutputWriter implements AutoCloseable {
    private OutputStream stream;
    byte[] buffer = new byte[10000];
    private int len = 0;

    private void addToBufferAndWriteIfFull(byte... bytes) throws IOException {
        if (buffer.length >= len + bytes.length) {
            System.arraycopy(bytes, 0, buffer, len, bytes.length);
            len += bytes.length;
        } else {
            System.arraycopy(bytes, 0, buffer, len, buffer.length - len);
            stream.write(buffer);
            System.arraycopy(bytes, buffer.length - len, buffer, 0, bytes.length - (buffer.length - len));
            len = bytes.length - (buffer.length - len);
        }
    }

    public OutputWriter(OutputStream stream) {
        this.stream = stream;
    }

    public void printWithSeparator(String separator, Object... objects) throws IOException {
        for (int i = 0; i < objects.length; ++i) {
            if (i != 0) addToBufferAndWriteIfFull(separator.getBytes());
            addToBufferAndWriteIfFull(objects[i].toString().getBytes());
        }
    }

    public void print(Object... objects) throws IOException {
        for (int i = 0; i < objects.length; ++i) {
            addToBufferAndWriteIfFull(objects[i].toString().getBytes());
        }
    }


    public void println(Object... objects) throws IOException {
        print(objects);
        print("\n");
    }

    public void printlnWithSeparator(String separator, Object... objects) throws IOException {
        printWithSeparator(separator, objects);
        print("\n");
    }

    @Override
    public void close() throws Exception {
        stream.write(buffer, 0, len);
        stream.close();
    }
}