#include <bits/stdc++.h>
using namespace std;
map<char, int> m;
void init() {
  m['A'] = 1, m['H'] = 1, m['I'] = 1;
  m['M'] = 1, m['U'] = 1, m['W'] = 1;
  m['T'] = 1, m['V'] = 1, m['v'] = 1;
  m['w'] = 1, m['X'] = 1, m['x'] = 1;
  m['O'] = 1, m['o'] = 1, m['Y'] = 1;
  m['b'] = 2, m['d'] = 2;
  m['p'] = 2, m['q'] = 2;
}
int main() {
  string str;
  init();
  cin >> str;
  int len = str.size();
  if (str.size() % 2) {
    if (m[str[len / 2]] != 1) {
      printf("NIE\n");
      return 0;
    }
  }
  int flag = 0;
  for (int i = 0, j = len - 1; i < len / 2; i++, j--) {
    if (!m[str[i]] || !m[str[j]]) {
      flag = 1;
      break;
    }
    if (str[i] != str[j]) {
      if (m[str[i]] != 2 || m[str[j]] != 2) {
        flag = 1;
        break;
      }
    }
    if ((str[i] == 'b' && str[j] != 'd') || (str[i] == 'd' && str[j] != 'b')) {
      flag = 1;
      break;
    }
    if ((str[i] == 'p' && str[j] != 'q') || (str[i] == 'q' && str[j] != 'p')) {
      flag = 1;
      break;
    }
  }
  if (flag)
    printf("NIE\n");
  else
    printf("TAK\n");
  return 0;
}
