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;
template <class T>
inline void maxi(T &x, T y) {
  if (y > x) x = y;
}
template <class T>
inline void mini(T &x, T y) {
  if (y < x) x = y;
}
const int N = 2e3 + 5, B = 0x7fffffff;
char s[N], s2[N];
char c[N];
char d[N];
bool ok;
int q;
int main() {
  scanf("%s", s);
  c['A'] = 'A';
  c['H'] = 'H';
  c['I'] = 'I';
  c['M'] = 'M';
  c['O'] = 'O';
  c['T'] = 'T';
  c['U'] = 'U';
  c['V'] = 'V';
  c['W'] = 'W';
  c['X'] = 'X';
  c['Y'] = 'Y';
  d['b'] = 'd';
  d['d'] = 'b';
  d['o'] = 'o';
  d['p'] = 'q';
  d['q'] = 'p';
  d['v'] = 'v';
  d['w'] = 'w';
  d['x'] = 'x';
  int n = strlen(s);
  for (int i = 0; i < n; i++) {
    if (isupper(s[i])) {
      if (c[(int)s[i]] == 0) continue;
      s2[q++] = c[(int)s[i]];
    } else {
      if (d[(int)s[i]] == 0) continue;
      s2[q++] = d[(int)s[i]];
    }
  }
  if (q != n) return puts("NIE"), !!0;
  for (int i = q - 1, j = 0; i >= 0 && j < n; i--, j++) {
    if (s2[i] != s[j]) return puts("NIE"), !!0;
  }
  puts("TAK");
  return !!0;
}