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;
long long int arr[100000];
vector<int> vec1;
vector<vector<int> > vec2;
int main() {
  string s;
  cin >> s;
  long long int n;
  n = s.length();
  if (n % 2 == 0) {
    long long int mid = n / 2;
    {
      for (int i = mid, j = mid - 1; i < n && j >= 0; j--, i++) {
        if (s[i] == 'p' && s[j] == 'q' || s[j] == 'p' && s[i] == 'q' ||
            s[i] == 'A' && s[j] == 'A' || s[i] == 'b' && s[j] == 'd' ||
            s[i] == 'H' && s[j] == 'H' || s[i] == 'I' && s[j] == 'I' ||
            s[i] == 'M' && s[j] == 'M' || s[i] == 'o' && s[j] == 'o' ||
            s[i] == 'O' && s[j] == 'O' || s[i] == 'T' && s[j] == 'T' ||
            s[i] == 'U' && s[j] == 'U' || s[i] == 'V' && s[j] == 'V' ||
            s[i] == 'v' && s[j] == 'v' || s[i] == 'W' && s[j] == 'W' ||
            s[i] == 'w' && s[j] == 'w' || s[i] == 'X' && s[j] == 'X' ||
            s[i] == 'x' && s[j] == 'x' || s[i] == 'Y' && s[j] == 'Y' ||
            s[j] == 'A' && s[i] == 'A' || s[j] == 'b' && s[i] == 'd' ||
            s[j] == 'H' && s[i] == 'H' || s[j] == 'I' && s[i] == 'I' ||
            s[j] == 'M' && s[i] == 'M' || s[j] == 'o' && s[i] == 'o' ||
            s[j] == 'O' && s[i] == 'O' || s[j] == 'T' && s[i] == 'T' ||
            s[j] == 'U' && s[i] == 'U' || s[j] == 'V' && s[i] == 'V' ||
            s[j] == 'v' && s[i] == 'v' || s[j] == 'W' && s[i] == 'W' ||
            s[j] == 'w' && s[i] == 'w' || s[j] == 'X' && s[i] == 'X' ||
            s[j] == 'x' && s[i] == 'x' || s[j] == 'Y' && s[i] == 'Y')
          ;
        else {
          cout << "NIE" << endl;
          return 0;
        }
      }
      cout << "TAK" << endl;
    }
  } else {
    long long int mid = n / 2;
    {
      if (s[mid] == 'A' || s[mid] == 'H' || s[mid] == 'I' || s[mid] == 'M' ||
          s[mid] == 'O' || s[mid] == 'o' || s[mid] == 'U' || s[mid] == 'V' ||
          s[mid] == 'v' || s[mid] == 'W' || s[mid] == 'w' || s[mid] == 'X' ||
          s[mid] == 'x' || s[mid] == 'Y' || s[mid] == 'T') {
        for (int i = mid + 1, j = mid - 1; i < n && j >= 0; j--, i++) {
          if (s[i] == 'p' && s[j] == 'q' || s[j] == 'p' && s[i] == 'q' ||
              s[i] == 'A' && s[j] == 'A' || s[i] == 'b' && s[j] == 'd' ||
              s[i] == 'H' && s[j] == 'H' || s[i] == 'I' && s[j] == 'I' ||
              s[i] == 'M' && s[j] == 'M' || s[i] == 'o' && s[j] == 'o' ||
              s[i] == 'O' && s[j] == 'O' || s[i] == 'T' && s[j] == 'T' ||
              s[i] == 'U' && s[j] == 'U' || s[i] == 'V' && s[j] == 'V' ||
              s[i] == 'v' && s[j] == 'v' || s[i] == 'W' && s[j] == 'W' ||
              s[i] == 'w' && s[j] == 'w' || s[i] == 'X' && s[j] == 'X' ||
              s[i] == 'x' && s[j] == 'x' || s[i] == 'Y' && s[j] == 'Y' ||
              s[j] == 'A' && s[i] == 'A' || s[j] == 'b' && s[i] == 'd' ||
              s[j] == 'H' && s[i] == 'H' || s[j] == 'I' && s[i] == 'I' ||
              s[j] == 'M' && s[i] == 'M' || s[j] == 'o' && s[i] == 'o' ||
              s[j] == 'O' && s[i] == 'O' || s[j] == 'T' && s[i] == 'T' ||
              s[j] == 'U' && s[i] == 'U' || s[j] == 'V' && s[i] == 'V' ||
              s[j] == 'v' && s[i] == 'v' || s[j] == 'W' && s[i] == 'W' ||
              s[j] == 'w' && s[i] == 'w' || s[j] == 'X' && s[i] == 'X' ||
              s[j] == 'x' && s[i] == 'x' || s[j] == 'Y' && s[i] == 'Y')
            ;
          else {
            cout << "NIE" << endl;
            return 0;
          }
        }
        cout << "TAK" << endl;
      } else {
        cout << "NIE";
      }
    }
  }
  return 0;
}