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.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class SPalindrome {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String s = br.readLine();
		ArrayList<Character> chars = new ArrayList<Character>();
		ArrayList<Character> bdqp = new ArrayList<Character>();
		chars.add('A');
		chars.add('b');
		chars.add('d');
		chars.add('H');
//		chars.add('i');
		chars.add('I');
//		chars.add('l');
		chars.add('M');
		chars.add('o');
		chars.add('O');
		chars.add('p');
		chars.add('q');
		chars.add('T');
		chars.add('U');
		chars.add('V');
		chars.add('v');
		chars.add('w');
		chars.add('W');
		chars.add('x');
		chars.add('X');
		chars.add('Y');
		
		bdqp.add('b');
		bdqp.add('q');
		bdqp.add('d');
		bdqp.add('p');
		
		int x = s.length()/2;
		int y = s.length();
		boolean flag = true;
		for (int i = 0; i < x; i++) {
			char curr = s.charAt(i);
			char currM = s.charAt(y-1-i);
			if(chars.contains(curr)){
				if(curr == 'b' && currM != 'd'){
					flag= false;
					break;
				}
				if(curr == 'd' && currM != 'b'){
					flag= false;
					break;
				}
				if(curr == 'p' && currM != 'q'){
					flag= false;
					break;
				}
				if(curr == 'q' && currM != 'p'){
					flag= false;
					break;
				}
				if(!bdqp.contains(curr) && curr != currM){
					flag = false;
					break;
				}
			}else{
				flag = false;
			}
		}
		if(y%2 == 1){
			char c = s.charAt(x);
			if(!chars.contains(c) || bdqp.contains(c)){
				flag = false;
			}
		}
		if(flag){
			System.out.println("TAK");
		}
		else{
			System.out.println("NIE");
		}

	}
}