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:
/*
 * The MIT License
 *
 * Copyright 2016 Mouad NACIRI <mouadnaciri1@gmail.com>.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.PrintStream;
import java.math.BigDecimal;
import java.util.*;

/**
 *
 * @author NACIRI Mouad <mouadnaciri1@gmail.com>
 * @version 1.5.2
 */

public class CF {
    /* VIP, DON'T TOUCH!! */
    static StringTokenizer ST;
    static BufferedReader IN;
    static PrintStream o, e;
    static {
        IN = new BufferedReader(new InputStreamReader(System.in));
        o = System.out;
        e = System.err;
    }
    /*
    int   2_147_483_647               /  -2_147_483_648
    long  9_223_372_036_854_775_807L  /  -9_223_372_036_854_775_808L
    */
    static boolean[] P, p;
    static char[] pv;
    public static void main(String[] ag) throws IOException {
        P = new boolean[]{ true, false, false, false, false, false, false, true, true, false, false, false, true, false, true, false, false, false, false, true, true, true, true, true, true, false };
        p = new boolean[]{ false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, true, true, true, false, false };
        pv = new char[256];
        pv['A'] = 'A';
        pv['H'] = 'H';
        pv['I'] = 'I';
        pv['M'] = 'M';
        pv['O'] = 'O';
        pv['T'] = 'T';
        pv['U'] = 'U';
        pv['V'] = 'V';
        pv['W'] = 'W';
        pv['X'] = 'X';
        pv['b'] = 'd';
        pv['d'] = 'b';
        pv['o'] = 'o';
        pv['p'] = 'q';
        pv['q'] = 'p';
        pv['v'] = 'v';
        pv['w'] = 'w';
        pv['x'] = 'x';
        
        char[] c = nlnt().toCharArray();
        
        int len = c.length;
        if(len % 2 == 1) {
            char ch = c[len >> 1];
            if((ch <= 'Z' && ch >= 'A' && !P[ch - 'A']) || (ch <= 'z' && ch >= 'a' && !p[ch - 'a'])) {
                o.print("NIE");
                System.exit(0);
            }
        }
        
        o.println(pal(len, c) ? "TAK" : "NIE");
        cAll();
    }
    static boolean pal(int len, char[] c) {
        int i = 0, j = len - 1;
        while(i < j) {
            char c1 = c[i], c2 = c[j];
            if(c1 <= 'Z' && c1 >= 'A') {
                if(c2 <= 'Z' && c2 >= 'A') {
                    if( (P[c1 - 'A'] && c1 == c2) || pv[c1] == c2 ) {
                        
                    } else {
                        return false;
                    }
                } else {
                    return false;
                }
            } else {
                if(c2 <= 'z' && c2 >= 'a') {
                    if( (p[c1 - 'a'] && c1 == c2) || pv[c1] == c2) {
                    
                    } else {
                        return false;
                    }
                } else {
                    return false;
                }
            }
            
            i++;
            j--;
        }
        return true;
    }
    
    static <Var> void dg(Var... vars) { for(Var obj : vars) { e.print(obj + " "); } e.println(); }
    
    //IO stuff...   
    static void ll() { ST = new StringTokenizer(nlnt()); }
    static void ll(String del) { ST = new StringTokenizer(nlnt(), del); }
    static void ll(String s, String del) { ST = new StringTokenizer(s, del); }
    static void lll(String s) { ST = new StringTokenizer(s); }
    
    static int tlen() { return ST == null ? 0 : ST.countTokens(); }
    static boolean hn() { return ST != null && ST.hasMoreTokens(); }
    static String n() {
        if(!hn()) { ll(); }
        return ST.nextToken();
    }
    static String nln() {
        String l = null;
        try {
            while((l = IN.readLine()) != null && l.trim().length() == 0) {}
        } catch(IOException e) { }
        ST = null;
        return l;
    }
    static String nlnt() {
        String l = null;
        try {
            while((l = IN.readLine()) != null && (l = l.trim()).length() == 0) {}
        } catch(IOException e) { }
        ST = null;
        return l;
    }
    static boolean nbl() { return Boolean.parseBoolean(n()); }
    static byte nb() { return Byte.parseByte(n()); }
    static byte nb(int radix) { return Byte.parseByte(n(), radix); }
    static double nd() { return Double.parseDouble(n()); }
    static float nf() { return Float.parseFloat(n()); }
    static int ni() { return Integer.parseInt(n()); }
    static int ni(int radix) { return Integer.parseInt(n(), radix); }
    static long nl() { return Long.parseLong(n()); }
    static long nl(int radix) { return Long.parseLong(n(), radix); }
    static short ns() { return Short.parseShort(n()); }
    static short ns(int radix) { return Short.parseShort(n(), radix); }
    
    static void cAll() throws IOException { IN.close(); }
}