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;
char str[1005];
int check(char x, char y) {
  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 == 'T' && y == 'T') return 1;
  if (x == 'H' && y == 'H') return 1;
  if (x == 'U' && y == 'U') 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 == 'V' && y == 'V') return 1;
  if (x == 'x' && y == 'x') return 1;
  if (x == 'w' && y == 'w') return 1;
  if (x == 'o' && y == 'o') return 1;
  if (x == 'v' && y == 'v') return 1;
  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;
  return 0;
}
int main() {
  cin >> str;
  int n = strlen(str);
  if (n % 2 == 0) {
    for (int i = 0; i < n / 2; i++) {
      if (!check(str[i], str[n - i - 1])) {
        cout << "NIE" << endl;
        return 0;
      }
    }
    cout << "TAK" << endl;
    return 0;
  } else {
    for (int i = 0; i <= n / 2; i++) {
      if (!check(str[i], str[n - i - 1])) {
        cout << "NIE" << endl;
        return 0;
      }
    }
    cout << "TAK" << endl;
    return 0;
  }
}