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.FileReader;
import java.io.IOException; 
import java.io.InputStreamReader; 
import java.util.Scanner; 
import java.util.StringTokenizer; 
import java.util.*;
import java.io.*;
public class codeforces 
{ 
   static class Student{
       long x,y;
        Student(long x,long y){
            this.x=x;
            this.y=y;
        }
    }
    static int prime[];
    static void sieveOfEratosthenes(int n) 
    { 
        // Create a boolean array "prime[0..n]" and initialize 
        // all entries it as true. A value in prime[i] will 
        // finally be false if i is Not a prime, else true. 
        int pos=0;
        prime= new int[n+1]; 
        for(int p = 2; p*p <=n; p++) 
        { 
            // If prime[p] is not changed, then it is a prime 
            if(prime[p] == 0)
            { 
                // Update all multiples of p
                prime[p]=p;
                for(int i = p*p; i <= n; i += p) 
                    prime[i] = p; 
            } 
        } 
    }
static    class Sortbyroll implements Comparator<Student> 
{ 
    // Used for sorting in ascending order of 
    // roll number 
    public int compare(Student c, Student b) 
    { 
        if(c.x<=b.x)
            return -1;
        return 1;
    } 
} 
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; 
        } 
    } 
 
    static class Edge{
        int a,b;
        Edge(int a,int b){
            this.a=a;
            this.b=b;
        }
    }
    static int parent[];
    static int rank[];
    //static int seg[];
    static void solve()throws IOException{
        FastReader sc=new FastReader();
        String s;
        int pos=0,i,j;
        s=sc.nextLine();
        HashMap<Character,Integer>map=new HashMap<>();
        map.put('o',1);
        map.put('v',1);
        map.put('w',1);
        map.put('x',1);
        map.put('A',1);
        map.put('H',1);
        map.put('I',1);
        map.put('M',1);
        map.put('T',1);
        map.put('U',1);
        map.put('V',1);
        map.put('W',1);
        map.put('X',1);
        map.put('Y',1);
        map.put('O',1);
        if(s.length()%2==0){
            i=s.length()/2-1;
            j=s.length()/2;
        }
        else{
            i=s.length()/2-1;
            if(!map.containsKey(s.charAt(s.length()/2)))
                pos=1;
            j=s.length()/2+1;
        }
        if(s.length()==1){
            if(map.containsKey(s.charAt(0)))
            System.out.println("TAK");
            else
                System.out.println("NIE");
        }
        else{
            while(i>=0&&j<s.length()){
                if(s.charAt(i)=='p'||s.charAt(i)=='q'||s.charAt(i)=='b'||s.charAt(i)=='d'){
                    if(s.charAt(i)=='p'){
                        if(s.charAt(j)!='q'){
                            pos=1;
                            break;
                        }
                    }
                    else if(s.charAt(i)=='q'){
                        if(s.charAt(j)!='p'){
                            pos=1;
                            break;
                        }
                    }
                    else if(s.charAt(i)=='b'){
                        if(s.charAt(j)!='d'){
                            pos=1;
                            break;
                        }
                    }
                    else if(s.charAt(i)=='d'){
                        if(s.charAt(j)!='b'){
                            pos=1;
                            break;
                        }
                    }
                    --i;
                    ++j;
                }
                else if((s.charAt(i)=='A'&&s.charAt(j)=='A')||(s.charAt(i)=='H'&&s.charAt(j)=='H')||(s.charAt(i)=='I'&&s.charAt(j)=='I')||(s.charAt(i)=='M'&&s.charAt(j)=='M')||(s.charAt(i)=='O'&&s.charAt(j)=='O')||(s.charAt(i)=='T'&&s.charAt(j)=='T')||(s.charAt(i)=='U'&&s.charAt(j)=='U')||(s.charAt(i)=='V'&&s.charAt(j)=='V')||(s.charAt(i)=='W'&&s.charAt(j)=='W')||(s.charAt(i)=='X'&&s.charAt(j)=='X')||(s.charAt(i)=='Y'&&s.charAt(j)=='Y')||(s.charAt(i)=='o'&&s.charAt(j)=='o')||(s.charAt(i)=='v'&&s.charAt(j)=='v')||(s.charAt(i)=='w'&&s.charAt(j)=='w')||(s.charAt(i)=='x'&&s.charAt(j)=='x')){
                    --i;
                    ++j;
                }
                else{
                    pos=1;
                    break;
                }
            }
            if(pos==1)
                System.out.println("NIE");
            else
                System.out.println("TAK");
        }
    }
    public static void main(String[] args){
        //long sum=0;
        try {
                codeforces.solve();
                } catch (Exception e) {
                    e.printStackTrace();
                }
    }
 /*static long power(long x, long y, long p) 
{ 
    long res = 1;      // Initialize result 
  
    x = x % p;  // Update x if it is more than or  
                // equal to p 
  
    /*while (y > 0) 
    { 
        // If y is odd, multiply x with result 
        if ((y & (long)1)%2!=0) 
            res = (res*x) % p; 
  
        // y must be even now 
        y = y>>1; // y = y/2 
        x = (x*x) % p;   
    } */
    //return res%p; 
   static int find(int x) 
    { 
        // Finds the representative of the set 
        // that x is an element of 
        while(parent[x]!=x) 
        { 
            // if x is not the parent of itself 
            // Then x is not the representative of 
            // his set,
            x=parent[x];
  
            // so we recursively call Find on its parent 
            // and move i's node directly under the 
            // representative of this set 
        } 
  
        return x; 
    }
    static void union(int x, int y) 
    { 
        // Find representatives of two sets 
        int xRoot = find(x), yRoot = find(y); 
  
        // Elements are in the same set, no need 
        // to unite anything. 
        if (xRoot == yRoot) 
            return; 
  
         // If x's rank is less than y's rank 
        if (rank[xRoot] < rank[yRoot]) 
  
            // Then move x under y  so that depth 
            // of tree remains less 
            parent[xRoot] = yRoot; 
  
        // Else if y's rank is less than x's rank 
        else if (rank[yRoot] < rank[xRoot]) 
  
            // Then move y under x so that depth of 
            // tree remains less 
            parent[yRoot] = xRoot; 
  
        else // if ranks are the same 
        { 
            // Then move y under x (doesn't matter 
            // which one goes where) 
            parent[yRoot] = xRoot; 
  
            // And increment the the result tree's 
            // rank by 1 
            rank[xRoot] = rank[xRoot] + 1; 
        } 
    } 
    static long gcd(long a, long b) 
    { 
        if (a == 0) 
            return b; 
        return gcd(b % a, a); 
    }
}