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>
char b[16] = {'A', 'H', 'O', 'o', 'T', 'U', 'V', 'v',
              'W', 'w', 'M', 'I', 'Y', 'X', 'x'};
int main() {
  int l, i, flag1, flag2, flag;
  char a[1000] = {'\0'};
  scanf("%s", a);
  l = strlen(a);
  flag1 = 0;
  flag2 = 0;
  flag = 0;
  for (i = (l + 1) / 2; i < l; i++) {
    flag1 = 0;
    flag2 = 0;
    if (a[i] == a[l - i - 1]) {
      if (strchr(b, a[i]) != NULL) {
        flag1 = 1;
      }
    }
    if ((a[i] == 'b' && a[l - i - 1] == 'd') ||
        (a[l - 1 - i] == 'b' && a[i] == 'd')) {
      flag2 = 1;
    }
    if ((a[i] == 'p' && a[l - i - 1] == 'q') ||
        (a[l - 1 - i] == 'p' && a[i] == 'q')) {
      flag2 = 1;
    }
    if (flag1 == 0 && flag2 == 0) {
      flag = 1;
      break;
    }
  }
  if (!flag) {
    if (l % 2 == 0)
      printf("TAK\n");
    else {
      if (strchr(b, a[l / 2]) != NULL)
        printf("TAK\n");
      else
        printf("NIE\n");
    }
  } else
    printf("NIE\n");
  return 0;
}