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;
string allowed = "AHIMOoTUVvWwXxYbdpq";
int main() {
  set<char> all;
  for (auto x : allowed) {
    all.insert(x);
  }
  string s;
  cin >> s;
  int n = s.size();
  for (int i = 0; i < n / 2; ++i) {
    if (all.find(s[i]) == all.end() or all.find(s[n - 1 - i]) == all.end()) {
      cout << "NIE";
      return 0;
    } else if (s[i] == 'p' or s[i] == 'q') {
      char other = 'p' + 'q' - s[i];
      if (s[n - 1 - i] != other) {
        cout << "NIE";
        return 0;
      }
    } else if (s[i] == 'b' or s[i] == 'd') {
      char other = 'b' + 'd' - s[i];
      if (s[n - 1 - i] != other) {
        cout << "NIE";
        return 0;
      }
    } else {
      char other = s[i];
      if (s[n - 1 - i] != other) {
        cout << "NIE";
        return 0;
      }
    }
  }
  if (n & 1) {
    char mid = s[n / 2];
    if (mid == 'b' or mid == 'd') {
      cout << "NIE";
    } else if (mid == 'p' or mid == 'q') {
      cout << "NIE";
    } else if (all.find(mid) != all.end()) {
      cout << "TAK";
    } else {
      cout << "NIE";
    }
  } else {
    cout << "TAK";
  }
}