#include <bits/stdc++.h>
using namespace std;
int fun(char s[], int i, int j) {
  if (s[i] == 'o' && s[j] == 'o' || s[i] == 'Y' && s[j] == 'Y' ||
      s[i] == 'X' && s[j] == 'X' || s[i] == 'W' && s[j] == 'W' ||
      s[i] == 'V' && s[j] == 'V' || s[i] == 'U' && s[j] == 'U' ||
      s[i] == 'T' && s[j] == 'T' || s[i] == 'O' && s[j] == 'O' ||
      s[i] == 'M' && s[j] == 'M' || s[i] == 'I' && s[j] == 'I' ||
      s[i] == 'H' && s[j] == 'H' || s[i] == 'A' && s[j] == 'A' ||
      s[i] == 'x' && s[j] == 'x' || s[i] == 'w' && s[j] == 'w' ||
      s[i] == 'v' && s[j] == 'v')
    return 1;
  else if (s[i] == 'b' && s[j] == 'd')
    return 1;
  else if (s[i] == 'd' && s[j] == 'b')
    return 1;
  else if (s[i] == 'q' && s[j] == 'p')
    return 1;
  else if (s[i] == 'p' && s[j] == 'q')
    return 1;
  else
    return 0;
}
int main() {
  char s[1001];
  int flag = 0;
  cin >> s;
  int mid = strlen(s) / 2;
  for (int i = 0, j = strlen(s) - 1; i < mid; i++, j--) {
    if (fun(s, i, j)) {
      continue;
      cout << "here";
    } else {
      cout << "NIE";
      flag = 1;
      break;
    }
  }
  if (flag == 0)
    if (strlen(s) % 2 != 0) {
      if (s[mid] == 'o' || s[mid] == 'Y' || s[mid] == 'X' || s[mid] == 'W' ||
          s[mid] == 'V' || s[mid] == 'U' || s[mid] == 'T' || s[mid] == 'O' ||
          s[mid] == 'M' || s[mid] == 'I' || s[mid] == 'H' || s[mid] == 'A' ||
          s[mid] == 'x' || s[mid] == 'w' || s[mid] == 'v')
        cout << "TAK";
      else
        cout << "NIE";
    } else if (flag == 0)
      cout << "TAK";
  return 0;
}
