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:
/*
 * Code Author: Akshay Miterani
 * DA-IICT
 */
import java.io.*;
import java.math.*;
import java.text.*;
import java.util.*;
 
public class A {
 
	static double eps=(double)1e-15;
	static long mod=(int)1e9+7;
	public static void main(String args[]){
		InputReader in = new InputReader(System.in);
		OutputStream outputStream = System.out;
		PrintWriter out = new PrintWriter(outputStream);
		//----------My Code----------
		HashSet<Character> h=new HashSet<Character>();
		h.add('A');
		h.add('H');
		h.add('I');
		h.add('M');
		h.add('O');
		h.add('o');
		h.add('T');
		h.add('U');
		h.add('V');
		h.add('v');
		h.add('W');
		h.add('w');
		h.add('X');
		h.add('x');
		h.add('Y');
		String s=in.nextLine();
		boolean ok=true;
		int n=s.length();
		for(int i=0;i<s.length()/2;i++){
			if(s.charAt(i)==s.charAt(n-i-1) && h.contains(s.charAt(i))){
				continue;
			}
			else if(s.charAt(i)=='b' && s.charAt(n-i-1)=='d'){
				continue;
			}
			else if(s.charAt(i)=='d' && s.charAt(n-i-1)=='b'){
				continue;
			}
			else if(s.charAt(i)=='p' && s.charAt(n-i-1)=='q'){
				continue;
			}
			else if(s.charAt(i)=='q' && s.charAt(n-i-1)=='p'){
				continue;
			}
			ok=false;
		}
		if(n%2==1 && !h.contains(s.charAt(n/2)))
			ok=false;
		System.out.println(ok?"TAK":"NIE");
		out.close();
		//---------------The End------------------
 
	}
	
	static char rev(char ch){
		if(ch=='L'){
			return 'R';
		}
		if(ch=='R'){
			return 'L';
		}
		if(ch=='U'){
			return 'D';
		}
		if(ch=='D'){
			return 'U';
		}
		return '*';
	}
	static class Pair implements Comparable<Pair> {
		int u;
		int v;
		StringBuilder sb=new StringBuilder();
		public Pair(int u, int v) {
			this.u = u;
			this.v = v;
		}
 
		public int hashCode() {
			int hu = (int) (u ^ (u >>> 32));
			int hv = (int) (v ^ (v >>> 32));
			return 31 * hu + hv;
		}
 
		public boolean equals(Object o) {
			Pair other = (Pair) o;
			return u == other.u && v == other.v;
		}
 
		public int compareTo(Pair other) {
			return Long.compare(u, other.u) != 0 ? Long.compare(u, other.u) : Long.compare(v, other.v);
		}
 
		public String toString() {
			return "[u=" + u + ", v=" + v + "]";
		}
	}
	public static void debug(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}
	static long modulo(long a,long b,long c) {
		long x=1;
		long y=a;
		while(b > 0){
			if(b%2 == 1){
				x=(x*y)%c;
			}
			y = (y*y)%c; // squaring the base
			b /= 2;
		}
		return  x%c;
	}
	static long gcd(long x, long y)
	{
		if(x==0)
			return y;
		if(y==0)
			return x;
		long r=0, a, b;
		a = (x > y) ? x : y; // a is greater number
		b = (x < y) ? x : y; // b is smaller number
		r = b;
		while(a % b != 0)
		{
			r = a % b;
			a = b;
			b = r;
		}
		return r;
	}
	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;
 
		public InputReader(InputStream inputstream) {
			reader = new BufferedReader(new InputStreamReader(inputstream));
			tokenizer = null;
		}
 
		public String nextLine(){
			String fullLine=null;
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					fullLine=reader.readLine();
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
				return fullLine;
			}
			return fullLine;
		}
		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}
		public long nextLong() {
			return Long.parseLong(next());
		}
		public int nextInt() {
			return Integer.parseInt(next());
		}
	}
}