Problem: Let's call a string "s-palindrome" if it is symmetric about the middle of the string. For example, the string "oHo" is "s-palindrome", but the string "aa" is not. The string "aa" is not "s-palindrome", because the second half of it is not a mirror reflection of the first half.

<image> English alphabet

You are given a string s. Check if the string is "s-palindrome".

Input

The only line contains the string s (1 ≤ |s| ≤ 1000) which consists of only English letters.

Output

Print "TAK" if the string s is "s-palindrome" and "NIE" otherwise.

Examples

Input

oXoxoXo


Output

TAK


Input

bod


Output

TAK


Input

ER


Output

NIE

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
int main() {
  string cad;
  int cont = 0;
  getline(cin, cad);
  int t = cad.size();
  int m = t / 2;
  int r = m - 1;
  int q = m;
  if (t > 1) {
    if (t == 2) {
      if (cad[m] == 'o' && cad[r] == 'o' || cad[m] == 'O' && cad[r] == 'O' ||
          cad[m] == 'A' && cad[r] == 'A' || cad[m] == 'T' && cad[r] == 'T' ||
          cad[m] == 'H' && cad[r] == 'H' || cad[m] == 'I' && cad[r] == 'I' ||
          cad[m] == 'M' && cad[r] == 'M' || cad[m] == 'U' && cad[r] == 'U' ||
          cad[m] == 'V' && cad[r] == 'V' || cad[m] == 'v' && cad[r] == 'v' ||
          cad[m] == 'W' && cad[r] == 'W' || cad[m] == 'w' && cad[r] == 'w' ||
          cad[m] == 'X' && cad[r] == 'X' || cad[m] == 'x' && cad[r] == 'x' ||
          cad[m] == 'Y' && cad[r] == 'Y' || cad[m] == 'b' && cad[r] == 'd' ||
          cad[m] == 'd' && cad[r] == 'b' || cad[m] == 'p' && cad[r] == 'q' ||
          cad[m] == 'q' && cad[r] == 'p') {
        cout << "TAK";
      } else {
        cout << "NIE";
      }
    } else {
      if (t % 2 == 0) {
        while (r != -1 || m != t) {
          if (cad[m] == 'A' && cad[r] == 'A' ||
              cad[m] == 'b' && cad[r] == 'd' ||
              cad[m] == 'd' && cad[r] == 'b' ||
              cad[m] == 'p' && cad[r] == 'q' ||
              cad[m] == 'q' && cad[r] == 'p' ||
              cad[m] == 'o' && cad[r] == 'o' ||
              cad[m] == 'O' && cad[r] == 'O' ||
              cad[m] == 'T' && cad[r] == 'T' ||
              cad[m] == 'H' && cad[r] == 'H' ||
              cad[m] == 'I' && cad[r] == 'I' ||
              cad[m] == 'M' && cad[r] == 'M' ||
              cad[m] == 'U' && cad[r] == 'U' ||
              cad[m] == 'V' && cad[r] == 'V' ||
              cad[m] == 'v' && cad[r] == 'v' ||
              cad[m] == 'W' && cad[r] == 'W' ||
              cad[m] == 'w' && cad[r] == 'w' ||
              cad[m] == 'X' && cad[r] == 'X' ||
              cad[m] == 'x' && cad[r] == 'x' ||
              cad[m] == 'Y' && cad[r] == 'Y') {
            m++;
            r--;
            cont++;
            if (cont == q) {
              cout << "TAK";
            }
          } else {
            cout << "NIE";
            break;
          }
        }
      } else {
        if (cad[m] == 'o' || cad[m] == 'O' || cad[m] == 'A' || cad[m] == 'T' ||
            cad[m] == 'H' || cad[m] == 'I' || cad[m] == 'M' || cad[m] == 'U' ||
            cad[m] == 'V' || cad[m] == 'v' || cad[m] == 'W' || cad[m] == 'w' ||
            cad[m] == 'X' || cad[m] == 'x' || cad[m] == 'Y') {
          int e = m + 1;
          while (r != -1 || e != t) {
            if (cad[r] == 'A' && cad[e] == 'A' ||
                cad[r] == 'b' && cad[e] == 'd' ||
                cad[r] == 'd' && cad[e] == 'b' ||
                cad[r] == 'p' && cad[e] == 'q' ||
                cad[r] == 'q' && cad[e] == 'p' ||
                cad[r] == 'o' && cad[e] == 'o' ||
                cad[r] == 'O' && cad[e] == 'O' ||
                cad[r] == 'T' && cad[e] == 'T' ||
                cad[r] == 'H' && cad[e] == 'H' ||
                cad[r] == 'I' && cad[e] == 'I' ||
                cad[r] == 'M' && cad[e] == 'M' ||
                cad[r] == 'U' && cad[e] == 'U' ||
                cad[r] == 'V' && cad[e] == 'V' ||
                cad[r] == 'v' && cad[e] == 'v' ||
                cad[r] == 'W' && cad[e] == 'W' ||
                cad[r] == 'w' && cad[e] == 'w' ||
                cad[r] == 'X' && cad[e] == 'X' ||
                cad[r] == 'x' && cad[e] == 'x' ||
                cad[r] == 'Y' && cad[e] == 'Y') {
              r--;
              e++;
              cont++;
              if (cont == q) {
                cout << "TAK";
              }
            } else {
              cout << "NIE";
              break;
            }
          }
        } else {
          cout << "NIE";
        }
      }
    }
  } else {
    if (cad[m] == 'o' || cad[m] == 'O' || cad[m] == 'A' || cad[m] == 'T' ||
        cad[m] == 'H' || cad[m] == 'I' || cad[m] == 'M' || cad[m] == 'U' ||
        cad[m] == 'V' || cad[m] == 'v' || cad[m] == 'W' || cad[m] == 'w' ||
        cad[m] == 'X' || cad[m] == 'x' || cad[m] == 'Y') {
      cout << "TAK";
    } else {
      cout << "NIE";
    }
  }
  return 0;
}