#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  string S2 = S;
  string match = "AMWYTIOHUVXxowvpqdb";
  for (int i = 0; i < S.size(); i++) {
    if (match.find(S[i]) == -1) {
      cout << "NIE";
      return 0;
    } else if (S[i] == 'b')
      S2[i] = 'd';
    else if (S[i] == 'd')
      S2[i] = 'b';
    else if (S[i] == 'p')
      S2[i] = 'q';
    else if (S[i] == 'q')
      S2[i] = 'p';
  }
  reverse(S2.begin(), S2.end());
  if (S2.compare(S) == 0)
    cout << "TAK" << endl;
  else
    cout << "NIE";
  return 0;
}
