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 s;
  cin >> s;
  int k1, k2, k = s.length() / 2;
  if (s.length() % 2 == 0) {
    k2 = k;
    k1 = k - 1;
  } else {
    k1 = k;
    if (s[k1] == 'w' || s[k1] == 'A' || s[k1] == 'H' || s[k1] == 'I' ||
        s[k1] == 'M' || s[k1] == 'O' || s[k1] == 'T' || s[k1] == 'U' ||
        s[k1] == 'V' || s[k1] == 'W' || s[k1] == 'X' || s[k1] == 'Y' ||
        s[k1] == 'o' || s[k1] == 'v' || s[k1] == 'x') {
      k1 = k - 1;
      k2 = k + 1;
    } else {
      cout << "NIE" << endl;
      return 0;
    }
  }
  while (k1 >= 0) {
    if (s[k1] == s[k2]) {
      if (s[k1] == 'w' || s[k1] == 'A' || s[k1] == 'H' || s[k1] == 'I' ||
          s[k1] == 'M' || s[k1] == 'O' || s[k1] == 'T' || s[k1] == 'U' ||
          s[k1] == 'V' || s[k1] == 'W' || s[k1] == 'X' || s[k1] == 'Y' ||
          s[k1] == 'o' || s[k1] == 'v' || s[k1] == 'x') {
        k1--;
        k2++;
      } else {
        cout << "NIE" << endl;
        return 0;
      }
    } else {
      char c[2];
      c[0] = s[k1], c[1] = s[k2];
      sort(c, c + 2);
      if ((c[0] == 'b' && c[1] == 'd') || (c[0] == 'p' && c[1] == 'q')) {
        k1--;
        k2++;
      } else {
        cout << "NIE" << endl;
        return 0;
      }
    }
  }
  cout << "TAK" << endl;
}