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.*;
import java.io.InputStreamReader; 
import java.util.Scanner; 
import java.util.StringTokenizer; 
import java.util.*;
import java.math.*;
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[])
    {
        Scanner sc=new Scanner(System.in);
        PrintWriter pw=new PrintWriter(System.out);
        int t=1;//sc.nextInt();
        Character c[]={'A','b','d','p','q','H','I','M','o','O','T','U','V','v','W','w','X','x','Y'};
        List<Character> l=Arrays.asList(c);int temp=0;
        while(t-->0)
        {
           String s=sc.next();
           char ch[]=s.toCharArray();
           for(int i=0,j=ch.length-1;i<=j;i++,j--)
           {
               if(ch[i]!='b' && ch[i]!='d'&& ch[i]!='p'&& ch[i]!='q')
               {
               if(l.indexOf(ch[i])<0 || ch[i]!=ch[j])
               {
                   pw.println("NIE");
                   temp=1;
                   break;
               }
               }
            else if((ch[i]=='b'&& ch[j]!='d')||(ch[i]=='d'&& ch[j]!='b')
            ||(ch[i]=='p'&& ch[j]!='q')||(ch[i]=='q'&& ch[j]!='p'))
            {
                 pw.println("NIE");
                 temp=1;
                 break;
            }
           }
           if(temp==0)
           pw.println("TAK");
        }
           pw.close();
    }
}