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;
void open() { freopen("data.txt", "r", stdin); }
void out() { freopen("out.txt", "w", stdout); }
const int maxn = 1e5 + 5;
const int MOD = 1e9 + 9;
const int INF = 0x3f3f3f3f;
bool test1(char ch) {
  string str = "AHIMOoTUVvWwXxY";
  for (int i = (0); i < (str.size()); ++i)
    if (ch == str[i]) return 1;
  return 0;
}
bool test2(char ch1, char ch2) {
  if (ch1 == ch2 && test1(ch1)) return 1;
  if ((ch1 == 'b' && ch2 == 'd') || (ch1 == 'd' && ch2 == 'b')) return 1;
  if ((ch1 == 'p' && ch2 == 'q') || (ch1 == 'q' && ch2 == 'p')) return 1;
  return 0;
}
char str[maxn];
int main() {
  scanf("%s", str);
  int len = strlen(str);
  bool ok = 1;
  if (len % 2) {
    if (!test1(str[len / 2])) ok = 0;
  }
  if (len % 2) {
    int i = len / 2 - 1, j = len / 2 + 1;
    while (i >= 0) {
      if (!test2(str[i], str[j])) ok = 0;
      i--;
      j++;
    }
  } else {
    int i = len / 2 - 1, j = len / 2;
    while (i >= 0) {
      if (!test2(str[i], str[j])) ok = 0;
      i--;
      j++;
    }
  }
  printf("%s", ok ? "TAK" : "NIE");
}