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.*;
import java.math.*;

public class Main { 
    
    public static void main(String[] args) throws java.lang.Exception { 
        //Reader pm =new Reader(); 
        Scanner pm = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int t = 1;
        while(t-- > 0){
            String s = pm.next();
            HashSet<Character> hs = new HashSet<>();
            HashSet<Character> hs2 = new HashSet<>();
            int n = s.length();
            hs.add('A');
            hs.add('H');
            hs.add('I');
            hs.add('M');
            hs.add('O');
            hs.add('T');
            hs.add('U');
            hs.add('V');
            hs.add('W');
            hs.add('X');
            hs.add('Y');
            
           // hs.add('i');
            hs.add('o');
            hs.add('v');
            hs.add('x');
            hs.add('w');
            hs.add('b');
            hs.add('d');
            hs.add('p');
            hs.add('q');
            
            hs2.add('b');
            hs2.add('d');
            hs2.add('p');
            hs2.add('q');
            
            if(n == 1){
                if(hs.contains(s.charAt(0)))
                    System.out.println("TAK");
                else
                    System.out.println("NIE");
                return;
                    
            }
            String x1 = "";
            String x2 = "";
            if(n % 2 == 1){
                x1 = s.substring(n/2+1,n);
                x2 = s.substring(0,n/2); 
                if(hs2.contains(s.charAt(n/2))){
                    System.out.println("NIE");
                    return;
                }
                
                if(!hs.contains(s.charAt(n/2))){
                    System.out.println("NIE");
                    return;
                }
            }
            else{
                x1 = s.substring(n/2,n);
                x2 = s.substring(0,n/2);   
            }
            StringBuffer sb = new StringBuffer(x1);
            for(int i=0;i<sb.length();i++){
                if(sb.charAt(i) == 'b')
                    sb.setCharAt(i,'d');
                else if(sb.charAt(i) == 'd')
                    sb.setCharAt(i,'b');
                    
                else if(sb.charAt(i) == 'p')
                    sb.setCharAt(i,'q');
                else if(sb.charAt(i) == 'q')
                    sb.setCharAt(i,'p');
                    
            }
            sb.reverse();
            x1 = sb.toString();
            //System.out.println(x1+" "+x2);
            for(int i=0;i<x2.length();i++){
                if(x2.charAt(i) == x1.charAt(i) && hs.contains(x2.charAt(i)))
                    continue;
                else {
                    System.out.println("NIE");
                    return;
                }
            }
            System.out.println("TAK");
        }
        //end of tests
        
    }
    //end of main class
    
    static class Reader { 
        final private int BUFFER_SIZE = 1 << 16; 
        private DataInputStream din; 
        private byte[] buffer; 
        private int bufferPointer, bytesRead; 
  
        public Reader() 
        { 
            din = new DataInputStream(System.in); 
            buffer = new byte[BUFFER_SIZE]; 
            bufferPointer = bytesRead = 0; 
        } 
  
        public Reader(String file_name) throws IOException 
        { 
            din = new DataInputStream(new FileInputStream(file_name)); 
            buffer = new byte[BUFFER_SIZE]; 
            bufferPointer = bytesRead = 0; 
        } 
  
        public String readLine() throws IOException 
        { 
            byte[] buf = new byte[64]; // line length 
            int cnt = 0, c; 
            while ((c = read()) != -1) 
            { 
                if (c == '\n') 
                    break; 
                buf[cnt++] = (byte) c; 
            } 
            return new String(buf, 0, cnt); 
        } 
  
        public int nextInt() throws IOException 
        { 
            int ret = 0; 
            byte c = read(); 
            while (c <= ' ') 
                c = read(); 
            boolean neg = (c == '-'); 
            if (neg) 
                c = read(); 
            do
            { 
                ret = ret * 10 + c - '0'; 
            }  while ((c = read()) >= '0' && c <= '9'); 
  
            if (neg) 
                return -ret; 
            return ret; 
        } 
  
        public long nextLong() throws IOException 
        { 
            long ret = 0; 
            byte c = read(); 
            while (c <= ' ') 
                c = read(); 
            boolean neg = (c == '-'); 
            if (neg) 
                c = read(); 
            do { 
                ret = ret * 10 + c - '0'; 
            } 
            while ((c = read()) >= '0' && c <= '9'); 
            if (neg) 
                return -ret; 
            return ret; 
        } 
  
        public double nextDouble() throws IOException 
        { 
            double ret = 0, div = 1; 
            byte c = read(); 
            while (c <= ' ') 
                c = read(); 
            boolean neg = (c == '-'); 
            if (neg) 
                c = read(); 
  
            do { 
                ret = ret * 10 + c - '0'; 
            } 
            while ((c = read()) >= '0' && c <= '9'); 
  
            if (c == '.') 
            { 
                while ((c = read()) >= '0' && c <= '9') 
                { 
                    ret += (c - '0') / (div *= 10); 
                } 
            } 
  
            if (neg) 
                return -ret; 
            return ret; 
        } 
  
        private void fillBuffer() throws IOException 
        { 
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE); 
            if (bytesRead == -1) 
                buffer[0] = -1; 
        } 
  
        private byte read() throws IOException 
        { 
            if (bufferPointer == bytesRead) 
                fillBuffer(); 
            return buffer[bufferPointer++]; 
        } 
  
        public void close() throws IOException 
        { 
            if (din == null) 
                return; 
            din.close(); 
        } 
    }
}