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;
using ll = long long;
using ld = long double;
using uint = unsigned int;
using ull = unsigned long long;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
double startTime;
double getCurrentTime() {
  return ((double)clock() - startTime) / CLOCKS_PER_SEC;
}
void suraj() {
  string s;
  cin >> s;
  string a = "TAK";
  string b = "NIE";
  vector<char> va, vb;
  int len = s.size();
  int t = 0;
  char c = 'o';
  if (len == 1) {
    if (s == "o" || s == "O" || s == "v" || s == "V" || s == "w" || s == "W" ||
        s == "x" || s == "X" || s == "A" || s == "M" || s == "H" || s == "T" ||
        s == "I" || s == "U" || s == "Y") {
      cout << a << "\n";
      return;
    } else {
      cout << b << "\n";
      return;
    }
  }
  if (len % 2 == 0) {
    t = len / 2;
  } else {
    t = (len) / 2 + 1;
    c = s[len / 2];
  }
  for (int i = 0; i < len / 2; i++) {
    va.push_back(s[i]);
  }
  for (int i = t; i < len; i++) {
    vb.push_back(s[i]);
  }
  reverse(vb.begin(), vb.end());
  for (int i = 0; i < len / 2; i++) {
    if ((va[i] == 'I' && vb[i] == 'I') || (va[i] == 'U' && vb[i] == 'U') ||
        (va[i] == 'Y' && vb[i] == 'Y') || (va[i] == 'T' && vb[i] == 'T') ||
        (va[i] == 'M' && vb[i] == 'M') || (va[i] == 'A' && vb[i] == 'A') ||
        (va[i] == 'H' && vb[i] == 'H') || (va[i] == 'b' && vb[i] == 'd') ||
        (va[i] == 'd' && vb[i] == 'b') || (va[i] == 'p' && vb[i] == 'q') ||
        (va[i] == 'q' && vb[i] == 'p') || (va[i] == 'x' && vb[i] == 'x') ||
        (va[i] == 'o' && vb[i] == 'o') || (va[i] == 'O' && vb[i] == 'O') ||
        (va[i] == 'X' && vb[i] == 'X') || (va[i] == 'v' && vb[i] == 'v') ||
        (va[i] == 'V' && vb[i] == 'V') || (va[i] == 'w' && vb[i] == 'w') ||
        (va[i] == 'W' && vb[i] == 'W')) {
      continue;
    } else {
      cout << "NIE"
           << "\n";
      return;
    }
  }
  if (c == 'o' || c == 'O' || c == 'v' || c == 'V' || c == 'w' || c == 'W' ||
      c == 'x' || c == 'X' || c == 'A' || c == 'H' || c == 'M' || c == 'T' ||
      c == 'I' || c == 'U' || c == 'Y')
    cout << a << "\n";
  else
    cout << b << "\n";
}
int main() {
  startTime = (double)clock();
  suraj();
  return 0;
}