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() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string word;
  int tam, i, j;
  getline(cin, word);
  tam = word.size();
  set<char> middle;
  middle.insert('A');
  middle.insert('H');
  middle.insert('I');
  middle.insert('M');
  middle.insert('O');
  middle.insert('o');
  middle.insert('T');
  middle.insert('U');
  middle.insert('V');
  middle.insert('v');
  middle.insert('W');
  middle.insert('w');
  middle.insert('X');
  middle.insert('x');
  middle.insert('Y');
  map<char, char> mapa;
  mapa['A'] = 'A';
  mapa['H'] = 'H';
  mapa['I'] = 'I';
  mapa['M'] = 'M';
  mapa['O'] = 'O';
  mapa['o'] = 'o';
  mapa['T'] = 'T';
  mapa['U'] = 'U';
  mapa['v'] = 'v';
  mapa['V'] = 'V';
  mapa['W'] = 'W';
  mapa['w'] = 'w';
  mapa['X'] = 'X';
  mapa['x'] = 'x';
  mapa['Y'] = 'Y';
  mapa['b'] = 'd';
  mapa['d'] = 'b';
  mapa['p'] = 'q';
  mapa['q'] = 'p';
  if (tam % 2 == 0) {
    i = (tam / 2) - 1;
    j = (tam / 2);
    bool error = false;
    while (i >= 0) {
      if (mapa.find(word[i]) == mapa.end()) {
        error = true;
      } else {
        if (word[j] != mapa[word[i]]) {
          error = true;
        }
      }
      i--;
      j++;
    }
    if (error) {
      cout << "NIE\n";
    } else {
      cout << "TAK\n";
    }
  } else {
    if (middle.find(word[(tam - 1) / 2]) != middle.end()) {
      i = ((tam - 1) / 2) - 1;
      j = ((tam - 1) / 2) + 1;
      bool error = false;
      while (i >= 0) {
        if (mapa.find(word[i]) == mapa.end()) {
          error = true;
        } else {
          if (word[j] != mapa[word[i]]) {
            error = true;
          }
        }
        i--;
        j++;
      }
      if (error) {
        cout << "NIE\n";
      } else {
        cout << "TAK\n";
      }
    } else {
      cout << "NIE\n";
    }
  }
  return 0;
}