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

public class Main{
  public static void main(String[] args){
    Solve slv = new Solve();
    boolean p = slv.slvg();
    if (p) System.out.println("TAK");
    else System.out.println("NIE");
  }
}

class Solve{
  String s;
  String can = "AAbddbHHIIMMOOooTTUUVVvvWWwwXXxxYYpqqp";
  String ap = "AHIMOoTUVvWwXxY";
  public boolean slvg(){
    Scanner in = new Scanner(System.in);
    s = in.nextLine();
    int n = s.length();
    boolean p = true;
    for (int i = 0; i < n / 2; ++i){
      if (!check(i, n - 1 - i)) p = false;
    }
    if (n % 2 != 0){
      if (ap.indexOf(s.charAt(n / 2)) == -1) p = false;
    }
    
    if (p) return true;
    else return false;
  }
  
  private boolean check(int i, int j){
    char a = s.charAt(i);
    char b = s.charAt(j);
    if (can.indexOf(a) == -1) return false;
    if (can.indexOf(b) == -1) return false;
    for (i = 0; i < can.length(); i += 2){
      if (can.charAt(i) == a && can.charAt(i + 1) == b) return true;
    }
    return false;
  }
}