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;
bool valid(char c) {
  if (c == 'a' || c == 'B' || c == 'C' || c == 'c' || c == 'D' || c == 'E' ||
      c == 'e' || c == 'F' || c == 'f' || c == 'G' || c == 'g' || c == 'h' ||
      c == 'i' || c == 'J' || c == 'j' || c == 'K' || c == 'k' || c == 'L' ||
      c == 'l' || c == 'm' || c == 'N' || c == 'n' || c == 'P' || c == 'Q' ||
      c == 'R' || c == 'r' || c == 'S' || c == 's' || c == 't' || c == 'u' ||
      c == 'y' || c == 'Z' || c == 'z')
    return false;
  return true;
}
bool valid1(char c) {
  if (c == 'a' || c == 'B' || c == 'C' || c == 'c' || c == 'D' || c == 'E' ||
      c == 'e' || c == 'F' || c == 'f' || c == 'G' || c == 'g' || c == 'h' ||
      c == 'i' || c == 'J' || c == 'j' || c == 'K' || c == 'k' || c == 'L' ||
      c == 'l' || c == 'm' || c == 'N' || c == 'n' || c == 'P' || c == 'Q' ||
      c == 'R' || c == 'r' || c == 'S' || c == 's' || c == 't' || c == 'u' ||
      c == 'y' || c == 'Z' || c == 'z' || c == 'b' || c == 'd' || c == 'p' ||
      c == 'q')
    return false;
  return true;
}
bool invert(char a, char b) {
  if (a == 'q' || a == 'd') swap(a, b);
  if ((a == 'p' && b == 'q') || (a == 'b' && b == 'd')) return true;
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  for (int i = 0; i < s.size() / 2; i++) {
    int mir = s.size() - i - 1;
    if (!valid(s[i]) || !valid(s[mir]) ||
        (s[i] != s[mir] && !invert(s[i], s[mir])) ||
        (s[i] == s[mir] && !valid1(s[i]))) {
      cout << "NIE"
           << "\n";
      return 0;
    }
  }
  if (s.size() % 2 && !valid1(s[s.size() / 2]))
    cout << "NIE"
         << "\n";
  else
    cout << "TAK"
         << "\n";
}