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