#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int n = s.size();
  char a[17] = {'A', 'H', 'I', 'M', 'O', 'T', 'U', 'V',
                'W', 'X', 'Y', 'o', 'v', 'w', 'x'};
  char b[4] = {'b', 'd', 'p', 'q'};
  for (int i = 0; i <= (n - 1) / 2; i++) {
    if (s[i] == b[0] && s[n - i - 1] == b[1])
      continue;
    else if (s[i] == b[1] && s[n - i - 1] == b[0])
      continue;
    else if (s[i] == b[2] && s[n - i - 1] == b[3])
      continue;
    else if (s[i] == b[3] && s[n - i - 1] == b[2])
      continue;
    else if (s[i] != s[n - i - 1]) {
      cout << "NIE";
      return 0;
    } else {
      char q = s[i];
      int e = 0;
      for (int j = 0; j < 15; j++) {
        if (q == a[j]) e++;
      }
      if (e == 0) {
        cout << "NIE";
        return 0;
      }
    }
  }
  cout << "TAK";
}
