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;
string s;
int cnt = 0, lnt, x;
char a[10005];
int main() {
  cin >> s;
  x = s.size();
  for (int i = 0; i < s.size(); i++) {
    a[i] = s[i];
    if (s[i] == 'A' or s[i] == 'H' or s[i] == 'I' or s[i] == 'M' or
        s[i] == 'O' or s[i] == 'o' or s[i] == 'T' or s[i] == 'U' or
        s[i] == 'V' or s[i] == 'v' or s[i] == 'Y' or s[i] == 'W' or
        s[i] == 'w' or s[i] == 'X' or s[i] == 'x' or s[i] == 'p' or
        s[i] == 'd' or s[i] == 'q' or s[i] == 'b')
      cnt++;
  }
  reverse(a, a + x);
  if (cnt == x) {
    for (int i = 0; i < x; i++) {
      if (a[i] == 'p' and s[i] == 'q') lnt++;
      if (a[i] == 'q' and s[i] == 'p') lnt++;
      if (a[i] == 'd' and s[i] == 'b') lnt++;
      if (a[i] == 'b' and s[i] == 'd') lnt++;
      if (a[i] == s[i] and a[i] != 'p' and a[i] != 'q' and a[i] != 'd' and
          a[i] != 'b')
        lnt++;
    }
  }
  if (lnt == x)
    cout << "TAK";
  else
    cout << "NIE";
}