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 pb_letters(vector<char>& letters) {
  letters.push_back('A');
  letters.push_back('H');
  letters.push_back('I');
  letters.push_back('M');
  letters.push_back('O');
  letters.push_back('o');
  letters.push_back('T');
  letters.push_back('U');
  letters.push_back('V');
  letters.push_back('v');
  letters.push_back('W');
  letters.push_back('w');
  letters.push_back('X');
  letters.push_back('x');
  letters.push_back('Y');
}
int main() {
  vector<char> letters;
  pb_letters(letters);
  string str = "";
  cin >> str;
  vector<char>::iterator iter;
  if (str.size() == 1) {
    iter = find(letters.begin(), letters.end(), str[0]);
    if (iter != letters.end()) {
      cout << "TAK" << endl;
      return 0;
    } else {
      cout << "NIE" << endl;
      return 0;
    }
  }
  int i = 0, j = str.size() - 1;
  while (true) {
    if (j < i) break;
    if (str[i] == str[j]) {
      iter = find(letters.begin(), letters.end(), str[i]);
      if (iter == letters.end()) {
        cout << "NIE" << endl;
        return 0;
      } else if (iter != letters.end()) {
        ++i;
        --j;
        continue;
      }
    }
    if ((str[i] == 'b' && str[j] == 'd') || (str[i] == 'd' && str[j] == 'b')) {
      ++i;
      --j;
      continue;
    }
    if ((str[i] == 'p' && str[j] == 'q') || (str[i] == 'q' && str[j] == 'p')) {
      ++i;
      --j;
      continue;
    }
    cout << "NIE" << endl;
    return 0;
  }
  cout << "TAK" << endl;
  return 0;
}