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;
int main() {
  string s;
  cin >> s;
  int l = s.size();
  bool f = 1;
  for (int i = 0; i < l / 2; i++) {
    if (s[i] == 'a' || s[i] == 'B' || s[i] == 'c' || s[i] == 'C' ||
        s[i] == 'E' || s[i] == 'e' || s[i] == 'F' || s[i] == 'f' ||
        s[i] == 'G' || s[i] == 'g' || s[i] == 'h' || s[i] == 'i' ||
        s[i] == 'J' || s[i] == 'j' || s[i] == 'K' || s[i] == 'k' ||
        s[i] == 'L' || s[i] == 'l' || s[i] == 'N' || s[i] == 'n' ||
        s[i] == 'P' || s[i] == 'Q' || s[i] == 'R' || s[i] == 'r' ||
        s[i] == 'S' || s[i] == 's' || s[i] == 't' || s[i] == 'u' ||
        s[i] == 'y' || s[i] == 'Z' || s[i] == 'z' || s[i] == 'D' ||
        s[i] == 'm') {
      f = 0;
      break;
    } else if (s[i] == 'A' || s[i] == 'H' || s[i] == 'I' || s[i] == 'M' ||
               s[i] == 'O' || s[i] == 'o' || s[i] == 'T' || s[i] == 'U' ||
               s[i] == 'V' || s[i] == 'v' || s[i] == 'W' || s[i] == 'w' ||
               s[i] == 'X' || s[i] == 'x' || s[i] == 'Y') {
      if (s[i] != s[l - i - 1]) {
        f = 0;
        break;
      }
    } else if (s[i] == 'b') {
      if (s[l - i - 1] != 'd') {
        f = 0;
        break;
      }
    } else if (s[i] == 'd') {
      if (s[l - i - 1] != 'b') {
        f = 0;
        break;
      }
    } else if (s[i] == 'p') {
      if (s[l - i - 1] != 'q') {
        f = 0;
        break;
      }
    } else if (s[i] == 'q') {
      if (s[l - i - 1] != 'p') {
        f = 0;
        break;
      }
    }
  }
  if (l % 2 == 1)
    if (!(s[l / 2] == 'A' || s[l / 2] == 'H' || s[l / 2] == 'I' ||
          s[l / 2] == 'M' || s[l / 2] == 'O' || s[l / 2] == 'o' ||
          s[l / 2] == 'T' || s[l / 2] == 'U' || s[l / 2] == 'V' ||
          s[l / 2] == 'v' || s[l / 2] == 'W' || s[l / 2] == 'w' ||
          s[l / 2] == 'X' || s[l / 2] == 'x' || s[l / 2] == 'Y'))
      f = 0;
  if (f == 0)
    cout << "NIE";
  else
    cout << "TAK";
  return 0;
}