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