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.InputStreamReader;
import java.util.StringTokenizer;
import java.util.Map;
import java.util.HashMap;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.Set;
import java.util.*;
import java.text.*;
public class JavaApplication76 {
  static char [] ch = {'A','b','d','H','I','p','q','M','O','o','T','U','V','v','W','w','X','x','Y'};
  public static boolean palin(String s){
      if(s.length()==0)
          return true;
      else if(s.length()==1&&(s.charAt(0)=='p'||s.charAt(0)=='q'||s.charAt(0)=='b'||s.charAt(0)=='d')){
         
      return false;}
      else if(s.length()==1)
      return true;
      
     if(s.charAt(0)==s.charAt(s.length()-1)){
        if(s.charAt(0)!='b'&&s.charAt(0)!='d'&&s.charAt(0)!='p'&&s.charAt(0)!='q')
          return palin(s.substring(1, s.length()-1));
     else
            return false;}
     else if(s.charAt(0)=='b'&&s.charAt(s.length()-1)=='d'||s.charAt(0)=='d'&&s.charAt(s.length()-1)=='b'||s.charAt(0)=='p'&&s.charAt(s.length()-1)=='q'||s.charAt(0)=='q'&&s.charAt(s.length()-1)=='p')
         return palin(s.substring(1, s.length()-1));
      else return false;
      
  }
  
 public static void main(String[] args)throws Exception {
BufferedReader  in = new BufferedReader(new InputStreamReader(System.in));
String str=(in.readLine());
boolean t =false;
for(int i= 0; i<str.length();i++){
   
    for(int j= 0; j<ch.length;j++)
      if(str.charAt(i)==ch[j]){
          t=true;break;}
      else 
          t=false;
    if(!t){
        System.out.println("NIE");
        System.exit(0);
    }
    t=false;
    }

if(palin(str))
         System.out.println("TAK");
else
         System.out.println("NIE");


}
     static double nextDouble(StringTokenizer tok){
    return Double.parseDouble(tok.nextToken());
}
public static int nextInt(StringTokenizer s) throws Exception {
        return Integer.parseInt(s.nextToken());
    }
public static long nextLong(StringTokenizer s) throws Exception {
        return Long.parseLong(s.nextToken());
    }
}