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 c[16] = {'A', 'H', 'I', 'M', 'O', 'T', 'U', 'V',
              'W', 'X', 'Y', 'o', 'v', 'w', 'x'};
int main() {
  char s[1005];
  cin >> s;
  int i, l = strlen(s), temp = 1, j;
  map<char, int> mp;
  for (i = 0; i < 15; i++) {
    mp[c[i]] = 1;
  }
  for (i = 0, j = l - 1; i <= j; i++, j--) {
    if (i == j) {
      if (mp[s[i]] == 0) {
        temp = 0;
        break;
      }
      continue;
    } else {
      if (mp[s[i]] == 1 && s[i] == s[j]) {
        continue;
      }
      if ((s[i] == 'b' && s[j] == 'd') || (s[i] == 'd' && s[j] == 'b') ||
          (s[i] == 'p' && s[j] == 'q') || (s[i] == 'q' && s[j] == 'p')) {
        continue;
      }
      temp = 0;
      break;
    }
  }
  if (temp == 1) {
    printf("TAK\n");
  } else {
    printf("NIE\n");
  }
}