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;
const int N = 1005;
char s[N];
int check(char x, char y) {
  if (x == 'A' && y == 'A') return 1;
  if (x == 'H' && y == 'H') return 1;
  if (x == 'I' && y == 'I') return 1;
  if (x == 'M' && y == 'M') return 1;
  if (x == 'O' && y == 'O') return 1;
  if (x == 'T' && y == 'T') return 1;
  if (x == 'U' && y == 'U') return 1;
  if (x == 'V' && y == 'V') return 1;
  if (x == 'W' && y == 'W') return 1;
  if (x == 'X' && y == 'X') return 1;
  if (x == 'Y' && y == 'Y') return 1;
  if (x == 'o' && y == 'o') return 1;
  if (x == 'v' && y == 'v') return 1;
  if (x == 'w' && y == 'w') return 1;
  if (x == 'x' && y == 'x') return 1;
  if (x == 'b' && y == 'd') return 1;
  if (x == 'd' && y == 'b') return 1;
  if (x == 'p' && y == 'q') return 1;
  if (x == 'q' && y == 'p') return 1;
  return 0;
}
int main() {
  scanf("%s", s + 1);
  int len = strlen(s + 1);
  int ans = 0;
  for (int i = 1; i <= len / 2; i++) {
    ans += check(s[i], s[len - i + 1]);
  }
  if (len % 2 == 1) {
    int l = len / 2 + 1;
    ans += check(s[l], s[l]);
    if (ans == 1 + len / 2)
      cout << "TAK";
    else
      cout << "NIE";
  } else {
    if (ans == len / 2)
      cout << "TAK";
    else
      cout << "NIE";
  }
  return 0;
}