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 q[1500];
char q1[60] = {'A', 'H', 'I', 'M', 'o', 'O', 'T', 'U',
               'V', 'v', 'w', 'W', 'X', 'x', 'Y'};
int main() {
  scanf("%s", q);
  int s = strlen(q);
  int flag = 0, sum;
  if (s == 1) {
    for (int i = 0; i < 15; i++) {
      if (q[0] == q1[i]) {
        flag = 1;
      }
      if (flag == 1) break;
    }
    if (flag == 1)
      printf("TAK\n");
    else
      printf("NIE\n");
    return 0;
  }
  if (s & 1) {
    for (int i = 0; i < 15; i++)
      if (q[s / 2] == q1[i]) {
        flag = 1;
        break;
      }
    if (flag == 1) {
      flag = 0;
      sum = 0;
      for (int i = s / 2 - 1, j = s / 2 + 1; i >= 0; i--, j++) {
        if (q[i] == q[j]) {
          for (int k = 0; k < 15; k++)
            if (q[i] == q1[k]) {
              flag = 1;
              sum++;
              break;
            }
        } else if ((q[i] == 'b' && q[j] == 'd') ||
                   (q[i] == 'd' && q[j] == 'b') ||
                   (q[i] == 'q' && q[j] == 'p') ||
                   (q[i] == 'p' && q[j] == 'q')) {
          sum++;
          flag = 1;
        }
        if (flag == 1)
          flag = 0;
        else
          break;
      }
    }
  } else {
    sum = 0;
    for (int i = s / 2 - 1, j = s / 2; i >= 0; i--, j++) {
      if (q[i] == q[j]) {
        for (int k = 0; k < 15; k++)
          if (q[i] == q1[k]) {
            flag = 1;
            sum++;
            break;
          }
      } else if ((q[i] == 'b' && q[j] == 'd') || (q[i] == 'd' && q[j] == 'b') ||
                 (q[i] == 'q' && q[j] == 'p') || (q[i] == 'p' && q[j] == 'q')) {
        sum++;
        flag = 1;
      }
      if (flag == 1)
        flag = 0;
      else
        break;
    }
  }
  if (sum == s / 2)
    printf("TAK\n");
  else
    printf("NIE\n");
  return 0;
}