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;
void print(vector<long long> ar) {
  for (long long i = 0; i < ar.size(); i++) cout << ar[i] << " ";
  cout << "\n";
}
void rprint(vector<long long> ar) {
  for (long long i = ar.size() - 1; i >= 0; i--) cout << ar[i] << " ";
  cout << "\n";
}
void solve() {
  map<char, char> m;
  string s;
  cin >> s;
  char ch1[11] = {'A', 'I', 'M', 'H', 'O', 'T', 'U', 'V', 'W', 'X', 'Y'};
  char ch2[4] = {'o', 'v', 'w', 'x'};
  if (s.length() == 1) {
    long long flagg = 1;
    for (long long z = 0; z < 11; z++) {
      if (ch1[z] == s[0]) {
        flagg = 0;
        break;
      }
    }
    for (long long z = 0; z < 4; z++) {
      if (ch2[z] == s[0]) flagg = 0;
      break;
    }
    if (flagg == 0)
      cout << "TAK"
           << "\n";
    else
      cout << "NIE"
           << "\n";
    return;
  }
  long long n = s.length() - 1;
  long long i = 0, j = n;
  while (i <= j) {
    long long flag = 1;
    for (long long z = 0; z < 11; z++) {
      if (ch1[z] == s[i] && s[i] == s[j]) {
        flag = 0;
        break;
      }
    }
    for (long long z = 0; z < 4; z++)
      if (ch2[z] == s[i] && s[i] == s[j]) {
        flag = 0;
        break;
      }
    if ((s[i] == 'd' && s[j] == 'b') || (s[i] == 'b' && s[j] == 'd')) flag = 0;
    if ((s[i] == 'p' && s[j] == 'q') || (s[i] == 'q' && s[j] == 'p')) flag = 0;
    if (flag == 1) {
      cout << "NIE"
           << "\n";
      return;
    }
    i++;
    j--;
  }
  cout << "TAK"
       << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  while (t--) {
    solve();
  }
}