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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.util.StringTokenizer;
import java.math.BigInteger;
import java.util.Locale;
import java.io.PrintWriter;
import java.util.ArrayList;

public class Main
{
    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

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

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
    public static void main(String[] args)
    {
        FastReader sc=new FastReader();
        PrintWriter pw = new PrintWriter(System.out);
           String str = sc.nextLine();
           char[] a = str.toCharArray();
           int l = a.length;
           String s = "AHIMOoTUVvWwXxYbdpq";
           boolean flag=false;
       /*    if(l==1 )
           {
               if(s.indexOf(str)!=-1)
                pw.println("TAK");
                else
                    pw.println("NIE");
           }*/
           for(int i=0,j=l-1;i<=j;i++,j--)
           {
               if(a[i]!='b' && a[i]!='d' && a[i]!='p' && a[i]!='q')
               {
                   if(a[i]!=a[j] || s.indexOf(a[i])<0)
                    {   
                        flag=true;
                        pw.println("NIE");
                        break;
                    }
               }
                else if((a[i]=='b'&& a[j]!='d')||(a[i]=='d'&& a[j]!='b') ||(a[i]=='p'&& a[j]!='q')||(a[i]=='q'&& a[j]!='p'))
                {
                    flag=true;
                    pw.println("NIE");
                    break;
                }
           }
           if(!flag)
            pw.println("TAK");
           pw.close();
    }
        
}