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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
char b[22][4] = {"AA", "bd", "db", "HH", "II", "MM", "OO", "oo", "pq", "TT",
                 "UU", "VV", "vv", "WW", "ww", "XX", "YY", "xx", "qp"};
char c[19] = {"AHIMOoTUVYvWwXx"};
int main() {
  char a[1005];
  int p;
  while (cin >> a) {
    p = 0;
    int p1 = 0;
    int d = strlen(a);
    if (d % 2 == 0) {
      d = d / 2;
      for (int i = d - 1; i >= 0; i--) {
        if (p == 1) break;
        for (int j = 0; j < 22; j++) {
          p = 1;
          if (a[i] == b[j][0] && a[2 * d - i - 1] == b[j][1]) {
            p = 0;
            break;
          }
        }
      }
      if (p == 0)
        cout << "TAK" << endl;
      else
        cout << "NIE" << endl;
    } else {
      d = d / 2;
      for (int i = 0; i <= 18; i++) {
        if (a[d] == c[i]) {
          p1 = 1;
          break;
        }
      }
      if (p1 == 1) {
        for (int i = d - 1; i >= 0; i--) {
          if (p == 1) break;
          for (int j = 0; j < 22; j++) {
            p = 1;
            if (a[i] == b[j][0] && a[2 * d - i] == b[j][1]) {
              p = 0;
              break;
            }
          }
        }
      }
      if (p1 == 0)
        cout << "NIE" << endl;
      else if (p == 0)
        cout << "TAK" << endl;
      else
        cout << "NIE" << endl;
    }
  }
  return 0;
}