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