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;
void prntVec(vector<int> &a) {
  for (auto i : a) cout << i << ' ';
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  bool f = 0;
  bool ans = 1;
  vector<char> chk = {'A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'W', 'X',
                      'Y', 'b', 'd', 'p', 'q', 'o', 'v', 'w', 'x'};
  for (int i = 0; s[i]; i++) {
    f = 0;
    for (int j = 0; j < chk.size(); j++) {
      if (chk[j] == s[i]) {
        f = 1;
        break;
      }
    }
    if (!f) {
      ans = 0;
      break;
    }
  }
  if (!ans)
    cout << "NIE";
  else {
    int _p = 0, _q = 0, _b = 0, _d = 0;
    for (int i = 0; s[i]; i++) {
      if (s[i] == 'p') _p++;
      if (s[i] == 'q') _q++;
      if (s[i] == 'b') _b++;
      if (s[i] == 'd') _d++;
    }
    if (_p == _q && _b == _d) {
      for (int i = 0; i < s.size(); i++) {
        if (s[i] == 'q') s[i] = 'p';
        if (s[i] == 'd') s[i] = 'b';
      }
      string b = s;
      reverse(b.begin(), b.end());
      if (s == b)
        cout << "TAK";
      else
        cout << "NIE";
    } else
      cout << "NIE";
  }
  return 0;
}