#include <bits/stdc++.h>
using namespace std;
int main() {
  string a;
  cin >> a;
  char c;
  if (a.size() % 2 != 0)
    c = a[a.size() / 2];
  else
    c = 'o';
  string b(a.rbegin(), a.rbegin() + a.size() / 2);
  a = string(a.begin(), a.begin() + a.size() / 2);
  for (int i = 0; i < a.size(); ++i) switch (a[i]) {
      case 'A':
        do {
          if (b[i] != ('A')) {
            puts("NIE");
            return 0;
          }
        } while (0);
        break;
      case 'b':
        do {
          if (b[i] != ('d')) {
            puts("NIE");
            return 0;
          }
        } while (0);
        break;
      case 'd':
        do {
          if (b[i] != ('b')) {
            puts("NIE");
            return 0;
          }
        } while (0);
        break;
      case 'H':
        do {
          if (b[i] != ('H')) {
            puts("NIE");
            return 0;
          }
        } while (0);
        break;
      case 'I':
        do {
          if (b[i] != ('I')) {
            puts("NIE");
            return 0;
          }
        } while (0);
        break;
      case 'M':
        do {
          if (b[i] != ('M')) {
            puts("NIE");
            return 0;
          }
        } while (0);
        break;
      case 'O':
        do {
          if (b[i] != ('O')) {
            puts("NIE");
            return 0;
          }
        } while (0);
        break;
      case 'o':
        do {
          if (b[i] != ('o')) {
            puts("NIE");
            return 0;
          }
        } while (0);
        break;
      case 'p':
        do {
          if (b[i] != ('q')) {
            puts("NIE");
            return 0;
          }
        } while (0);
        break;
      case 'q':
        do {
          if (b[i] != ('p')) {
            puts("NIE");
            return 0;
          }
        } while (0);
        break;
      case 'T':
        do {
          if (b[i] != ('T')) {
            puts("NIE");
            return 0;
          }
        } while (0);
        break;
      case 'U':
        do {
          if (b[i] != ('U')) {
            puts("NIE");
            return 0;
          }
        } while (0);
        break;
      case 'V':
        do {
          if (b[i] != ('V')) {
            puts("NIE");
            return 0;
          }
        } while (0);
        break;
      case 'v':
        do {
          if (b[i] != ('v')) {
            puts("NIE");
            return 0;
          }
        } while (0);
        break;
      case 'W':
        do {
          if (b[i] != ('W')) {
            puts("NIE");
            return 0;
          }
        } while (0);
        break;
      case 'w':
        do {
          if (b[i] != ('w')) {
            puts("NIE");
            return 0;
          }
        } while (0);
        break;
      case 'X':
        do {
          if (b[i] != ('X')) {
            puts("NIE");
            return 0;
          }
        } while (0);
        break;
      case 'x':
        do {
          if (b[i] != ('x')) {
            puts("NIE");
            return 0;
          }
        } while (0);
        break;
      case 'Y':
        do {
          if (b[i] != ('Y')) {
            puts("NIE");
            return 0;
          }
        } while (0);
        break;
      default:
        puts("NIE");
        return 0;
    }
  switch (c) {
    case 'A':
    case 'H':
    case 'I':
    case 'M':
    case 'O':
    case 'o':
    case 'T':
    case 'U':
    case 'V':
    case 'v':
    case 'W':
    case 'w':
    case 'X':
    case 'x':
    case 'Y':
      puts("TAK");
      break;
    default:
      puts("NIE");
      break;
  }
  return 0;
}
