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:
//package com.company;

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.*;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.io.InputStream;
import java.util.function.BiFunction;
import java.util.function.IntBinaryOperator;

public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Solver solver = new Solver();
        solver.solve(in, out);
        out.close();
    }

    static class Solver
    {
        public void solve (InputReader in, PrintWriter out) {
            String s = in.next();
            String can = "AHIMOoTUVvWwXxY";
            boolean ok = true;
            for (int i = 0; i < s.length(); i++)
            {
                if (s.charAt(i) == 'b')
                {
                    ok &= s.charAt(s.length() - i - 1) == 'd';
                    continue;
                }
                else if (s.charAt(i) == 'd')
                {
                    ok &= s.charAt(s.length() - i - 1) == 'b';
                    continue;
                }
                else if (s.charAt(i) == 'q')
                {
                    ok &= s.charAt(s.length() - i - 1) == 'p';
                    continue;
                }
                else if (s.charAt(i) == 'p')
                {
                    ok &= s.charAt(s.length() - i - 1) == 'q';
                    continue;
                }

                ok &= (s.charAt(i) == s.charAt(s.length() - i - 1));
                boolean cur = false;
                for (int j = 0; j < can.length(); j++)
                    cur |= (can.charAt(j) == s.charAt(i));
                ok &= cur;
            }
            out.println(ok ? "TAK" : "NIE");
        }
    }

    static 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 int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong()
        {
            return Long.parseLong(next());
        }
    }
}