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;
char s[1007], l[1007];
int dem;
int main() {
  cin >> s;
  for (int i = 0; i < strlen(s); ++i) {
    if (s[i] != 'A' && s[i] != 'b' && s[i] != 'H' && s[i] != 'd' &&
        s[i] != 'I' && s[i] != 'M' && s[i] != 'O' && s[i] != 'o' &&
        s[i] != 'p' && s[i] != 'q' && 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') {
      cout << "NIE";
      return 0;
    }
  }
  int j = 0;
  for (int i = strlen(s) - 1; i >= 0; --i) {
    l[j] = s[i];
    ++j;
  }
  for (int i = 0; i < strlen(s); ++i) {
    if (s[i] != 'b' && s[i] != 'd' && s[i] != 'p' && s[i] != 'q' &&
        l[i] != 'b' && l[i] != 'd' && l[i] != 'p' && l[i] != 'q') {
      if (s[i] == l[i]) ++dem;
    } else if (((s[i] == 'b' && l[i] == 'd') || (s[i] == 'd' && l[i] == 'b')) ||
               ((s[i] == 'q' && l[i] == 'p') || (s[i] == 'p' && l[i] == 'q')))
      ++dem;
  }
  if (dem == strlen(s))
    cout << "TAK";
  else
    cout << "NIE";
  return 0;
}