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 long long INF = 1e18, MAXN = 1e5 + 1111, MOD = 1e9 + 7;
long long NOD(long long NOD1, long long NOD2) {
  while (NOD2) {
    NOD1 %= NOD2;
    swap(NOD1, NOD2);
  }
  return NOD1;
}
long long NOK(long long NOK1, long long NOK2) {
  return NOK1 * NOK2 / NOD(NOK1, NOK2);
}
string s, s1;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> s;
  for (int i = 0; i < s.size() / 2; i++) {
    if (s[i] == 'p')
      s1 += 'q';
    else if (s[i] == 'b')
      s1 += 'd';
    else if (s[i] == 'd')
      s1 += 'b';
    else if (s[i] == 'q')
      s1 += 'p';
    else if (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' || s[i] == 'M' ||
             s[i] == 'A' || s[i] == 'H' || s[i] == 'I')
      s1 += s[i];
    else
      return cout << "NIE", 0;
  }
  reverse(s1.begin(), s1.end());
  int i = s.size() / 2;
  if (s.size() % 2 == 1 &&
      (s[i] != 'A' && s[i] != 'W' && s[i] != 'w' && s[i] != 'T' &&
       s[i] != 'Y' && s[i] != 'U' && s[i] != 'I' && s[i] != 'H' & s[i] != 'X' &&
       s[i] != 'x' && s[i] != 'V' && s[i] != 'v' && s[i] != 'M' &&
       s[i] != 'o' && s[i] != 'O'))
    return cout << "NIE", 0;
  if (s.size() % 2 == 1) s1 += 'i';
  for (int i = s1.size(); i < s.size(); i++)
    if (s1[i - s1.size()] != s[i]) return cout << "NIE", 0;
  cout << "TAK";
}