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() {
  string s;
  cin >> s;
  string prv = "", vtor = "";
  for (int i = 0; i < s.size() / 2; i++) {
    if (s[i] == 'b')
      s[i] = 'd';
    else if (s[i] == 'd')
      s[i] = 'b';
    if (s[i] == 'p')
      s[i] = 'q';
    else if (s[i] == 'q')
      s[i] = 'p';
    prv += s[i];
    vtor += s[s.size() - i - 1];
  }
  if (s.size() % 2 == 1) {
    int i = (s.size()) / 2;
    if (s[i] != 'A' && s[i] != 'H' && s[i] != 'I' && s[i] != 'M' &&
        s[i] != 'O' && s[i] != 'o' && s[i] != 'T' && s[i] != 'U' &&
        s[i] != 'V' && s[i] != 'v' && s[i] != 'W' && s[i] != 'w' &&
        s[i] != 'X' && s[i] != 'x' && s[i] != 'Y') {
      cout << "NIE";
      return 0;
    }
  }
  if (prv == vtor) {
    for (int i = 0; i < prv.size(); i++) {
      if (prv[i] != 'A' && prv[i] != 'H' && prv[i] != 'I' && prv[i] != 'M' &&
          prv[i] != 'O' && prv[i] != 'o' && prv[i] != 'T' && prv[i] != 'U' &&
          prv[i] != 'V' && prv[i] != 'v' && prv[i] != 'W' && prv[i] != 'w' &&
          prv[i] != 'X' && prv[i] != 'x' && prv[i] != 'Y') {
        if (prv[i] != 'b' && prv[i] != 'd' && prv[i] != 'p' && prv[i] != 'q') {
          cout << "NIE";
          return 0;
        }
      }
    }
    cout << "TAK";
    return 0;
  }
  cout << "NIE";
  return 0;
}