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() {
  map<char, char> mirr;
  mirr['A'] = 'A';
  mirr['b'] = 'd';
  mirr['d'] = 'b';
  mirr['H'] = 'H';
  mirr['I'] = 'I';
  mirr['M'] = 'M';
  mirr['O'] = 'O';
  mirr['o'] = 'o';
  mirr['T'] = 'T';
  mirr['U'] = 'U';
  mirr['V'] = 'V';
  mirr['v'] = 'v';
  mirr['W'] = 'W';
  mirr['w'] = 'w';
  mirr['X'] = 'X';
  mirr['x'] = 'x';
  mirr['Y'] = 'Y';
  mirr['q'] = 'p';
  mirr['p'] = 'q';
  char c;
  vector<char> str;
  while (cin >> c) {
    str.push_back(c);
    if (!((c == 'A') || (c == 'b') || (c == 'd') || (c == 'H') || (c == 'I') ||
          (c == 'M') || (c == 'O') || (c == 'o') || (c == 'T') || (c == 'U') ||
          (c == 'V') || (c == 'v') || (c == 'W') || (c == 'w') || (c == 'X') ||
          (c == 'x') || (c == 'Y') || (c == 'q') || (c == 'p'))) {
      cout << "NIE";
      return 0;
    }
  }
  int n = str.size();
  if (n != 1) {
    for (int i = 0; i <= (str.size() / 2 - 1); ++i) {
      int mirror = (n - i - 1);
      if (!(mirr[str[i]] == str[mirror])) {
        cout << "NIE";
        return 0;
      }
    }
  }
  int i = str.size() / 2;
  if (str.size() % 2 != 0) {
    if (mirr[str[i]] == str[i])
      cout << "TAK";
    else
      cout << "NIE";
  } else
    cout << "TAK";
}