#include <bits/stdc++.h>
using namespace std;
char chr[] = "HIOoTUMAVvWwxXY";
bool check(char c1, char c2) {
  if (c1 == 'b' && c2 == 'd' || c1 == 'd' && c2 == 'b') {
    return true;
  } else if (c1 == 'p' && c2 == 'q' || c1 == 'q' && c2 == 'p') {
    return true;
  }
  for (int i = 0; i < 15; i++) {
    if (c1 == chr[i] && c2 == chr[i]) return true;
  }
  return false;
}
int main(void) {
  int mid, len;
  string s;
  cin >> s;
  bool b = false;
  len = s.length();
  mid = len / 2;
  if (len % 2 == 0) {
    for (int i = 0; i < mid; i++) {
      if (check(s[i], s[(len - i) - 1]) == false) {
        cout << "NIE";
        return 0;
      }
    }
  } else {
    for (int i = 0; i < 15; i++) {
      if (s[mid] == chr[i]) {
        b = true;
      }
    }
    if (b == false) {
      cout << "NIE";
      return 0;
    }
    for (int i = 1; i <= mid; i++) {
      if (check(s[mid - i], s[mid + i]) == false) {
        cout << "NIE";
        return 0;
      }
    }
  }
  cout << "TAK";
  return 0;
}
