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 maxn = 1005;
char T[maxn];
int n;
bool verif(char ch) {
  if (ch == 'a') return 0;
  if (ch == 'B') return 0;
  if (ch == 'C') return 0;
  if (ch == 'c') return 0;
  if (ch == 'D') return 0;
  if (ch == 'E') return 0;
  if (ch == 'e') return 0;
  if (ch == 'F') return 0;
  if (ch == 'f') return 0;
  if (ch == 'G') return 0;
  if (ch == 'g') return 0;
  if (ch == 'h') return 0;
  if (ch == 'i') return 0;
  if (ch == 'J') return 0;
  if (ch == 'j') return 0;
  if (ch == 'K') return 0;
  if (ch == 'k') return 0;
  if (ch == 'L') return 0;
  if (ch == 'l') return 0;
  if (ch == 'm') return 0;
  if (ch == 'N') return 0;
  if (ch == 'n') return 0;
  if (ch == 'P') return 0;
  if (ch == 'Q') return 0;
  if (ch == 'R') return 0;
  if (ch == 'r') return 0;
  if (ch == 's') return 0;
  if (ch == 'S') return 0;
  if (ch == 'u') return 0;
  if (ch == 't') return 0;
  if (ch == 'y') return 0;
  if (ch == 'Z') return 0;
  if (ch == 'z') return 0;
  return 1;
}
bool verificare(char x, char y) {
  if (x == 'p' && y == 'q') return 1;
  if (x == 'q' && y == 'p') return 1;
  if (x == 'b' && y == 'd') return 1;
  if (x == 'd' && y == 'b') return 1;
  if (x == 'H' && y == 'H') return 1;
  if (x == 'A' && y == 'A') 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 == '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 == 'w' && y == 'w') return 1;
  if (x == 'v' && y == 'v') return 1;
  if (x == 'x' && y == 'x') return 1;
  if (x == 'X' && y == 'X') return 1;
  if (x == 'Y' && y == 'Y') return 1;
  return 0;
}
bool pali() {
  for (int i = 1; i <= n / 2; i++)
    if (!verificare(T[i], T[n - i + 1])) return 0;
  if (n % 2 == 1) {
    int p = n / 2 + 1;
    if (T[p] == 'b' || T[p] == 'q' || T[p] == 'd' || T[p] == 'p') return 0;
    if (verif(T[p])) return 1;
    return 0;
  }
  return 1;
}
int main() {
  cin.getline(T + 1, maxn);
  n = strlen(T + 1);
  for (int i = 1; i <= n; i++) {
    if (!verif(T[i])) {
      cout << "NIE";
      return 0;
    }
  }
  if (pali())
    cout << "TAK";
  else
    cout << "NIE";
  return 0;
}