#include <bits/stdc++.h>
using namespace std;
template <typename T>
T nextInt() {
  T x = 0, p = 1;
  char ch;
  do {
    ch = getchar();
  } while (ch <= ' ');
  if (ch == '-') {
    p = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + (ch - '0');
    ch = getchar();
  }
  return x * p;
}
const int maxN = (int)1e6 + 10;
const int INF = (int)1e9 + 5;
const int mod = (int)1e9 + 7;
const long long LLINF = (long long)1e18 + 5;
char ok[257];
void make(string s) {
  for (auto x : s) ok[x] = true;
}
void bad() {
  cout << "NIE\n";
  exit(0);
}
bool OK(char a, char b) {
  if (a == 'b' && b == 'd') return true;
  if (b == 'b' && a == 'd') return true;
  if (a == 'p' && b == 'q') return true;
  if (b == 'p' && a == 'q') return true;
  return a == b && ok[a];
}
int main() {
  make("AHIMOoTUVvWwXxY");
  string s;
  cin >> s;
  int n = s.length();
  for (int i = 0; i < n / 2; ++i) {
    if (!OK(s[i], s[n - i - 1])) bad();
  }
  if (n % 2 == 1 && !ok[s[n / 2]]) {
    bad();
  }
  cout << "TAK\n";
  return 0;
}
