#include <bits/stdc++.h>
using namespace std;
string s;
int cnt = 0, lnt, x;
char a[10005];
int main() {
  cin >> s;
  x = s.size();
  for (int i = 0; i < s.size(); i++) {
    a[i] = s[i];
    if (s[i] == 'A' or s[i] == 'H' or s[i] == 'I' or s[i] == 'M' or
        s[i] == 'O' or s[i] == 'o' or s[i] == 'T' or s[i] == 'U' or
        s[i] == 'V' or s[i] == 'v' or s[i] == 'Y' or s[i] == 'W' or
        s[i] == 'w' or s[i] == 'X' or s[i] == 'x' or s[i] == 'p' or
        s[i] == 'd' or s[i] == 'q' or s[i] == 'b')
      cnt++;
  }
  reverse(a, a + x);
  if (cnt == x) {
    for (int i = 0; i < x; i++) {
      if (a[i] == 'p' and s[i] == 'q') lnt++;
      if (a[i] == 'q' and s[i] == 'p') lnt++;
      if (a[i] == 'd' and s[i] == 'b') lnt++;
      if (a[i] == 'b' and s[i] == 'd') lnt++;
      if (a[i] == s[i] and a[i] != 'p' and a[i] != 'q' and a[i] != 'd' and
          a[i] != 'b')
        lnt++;
    }
  }
  if (lnt == x)
    cout << "TAK";
  else
    cout << "NIE";
}
