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;
inline int read() {
  register int x = 0, f = 1, ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return x * f;
}
string s;
char a[] = {'A', 'H', 'I', 'M', 'O', 'o', 'T', 'U',
            'V', 'v', 'W', 'w', 'X', 'x', 'Y'};
int main() {
  cin >> s;
  if (s.length() % 2 == 1) {
    for (int i = 0; i <= 14; i++) {
      if (s[s.length() / 2] == a[i]) {
        break;
      }
      if (i == 14) {
        printf("NIE");
        return 0;
      }
    }
  }
  for (int i = 0; i < s.length() / 2; i++) {
    bool flag = 0;
    for (int j = 0; j <= 14; j++) {
      if (s[s.length() - i - 1] == a[j] && s[i] == a[j]) {
        flag = 1;
        break;
      }
    }
    if ((s[s.length() - i - 1] == 'b' && s[i] == 'd') ||
        (s[s.length() - i - 1] == 'd' && s[i] == 'b') ||
        (s[s.length() - i - 1] == 'p' && s[i] == 'q') ||
        (s[s.length() - i - 1] == 'q' && s[i] == 'p')) {
      flag = 1;
    }
    if (!flag) {
      printf("NIE");
      return 0;
    }
  }
  puts("TAK");
  return 0;
}