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;
map<char, int> m;
void init() {
  m['A'] = 1, m['H'] = 1, m['I'] = 1;
  m['M'] = 1, m['U'] = 1, m['W'] = 1;
  m['T'] = 1, m['V'] = 1, m['v'] = 1;
  m['w'] = 1, m['X'] = 1, m['x'] = 1;
  m['O'] = 1, m['o'] = 1, m['Y'] = 1;
  m['b'] = 2, m['d'] = 2;
  m['p'] = 2, m['q'] = 2;
}
int main() {
  string str;
  init();
  cin >> str;
  int len = str.size();
  if (str.size() % 2) {
    if (m[str[len / 2]] != 1) {
      printf("NIE\n");
      return 0;
    }
  }
  int flag = 0;
  for (int i = 0, j = len - 1; i < len / 2; i++, j--) {
    if (!m[str[i]] || !m[str[j]]) {
      flag = 1;
      break;
    }
    if (str[i] != str[j]) {
      if (m[str[i]] != 2 || m[str[j]] != 2) {
        flag = 1;
        break;
      }
    }
    if ((str[i] == 'b' && str[j] != 'd') || (str[i] == 'd' && str[j] != 'b')) {
      flag = 1;
      break;
    }
    if ((str[i] == 'p' && str[j] != 'q') || (str[i] == 'q' && str[j] != 'p')) {
      flag = 1;
      break;
    }
  }
  if (flag)
    printf("NIE\n");
  else
    printf("TAK\n");
  return 0;
}