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;
inline void boost() {
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
}
string s;
bool check(int i) {
  if (s[i] == 'A' || tolower(s[i]) == 'x' || s[i] == 'H' || s[i] == 'I' ||
      s[i] == 'M' || tolower(s[i]) == 'o' || s[i] == 'T' || s[i] == 'U' ||
      tolower(s[i]) == 'v' || tolower(s[i]) == 'w' || s[i] == 'Y')
    return (s[(int)s.size() - 1 - i] == s[i] ? 1 : 0);
  if (s[i] == 'b') return (s[(int)s.size() - 1 - i] == 'd' ? 1 : 0);
  if (s[i] == 'd') return (s[(int)s.size() - 1 - i] == 'b' ? 1 : 0);
  if (s[i] == 'p') return (s[(int)s.size() - 1 - i] == 'q' ? 1 : 0);
  if (s[i] == 'q') return (s[(int)s.size() - 1 - i] == 'p' ? 1 : 0);
  return 0;
}
int main() {
  cin >> s;
  for (int i = 0; i < (int)s.size() / 2; i++) {
    if (!check(i)) {
      cout << "NIE";
      return 0;
    }
  }
  if ((int)s.size() % 2)
    cout << (check((int)s.size() / 2) ? "TAK" : "NIE");
  else
    cout << "TAK";
  return 0;
}