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;
const int inf = 0x3f3f3f3f;
const long long INF = 2e18;
const int N = 1234;
int n, m;
char s[N];
int dui[N];
int main() {
  cin >> s;
  int i, j;
  int len = strlen(s);
  memset(dui, -1, sizeof(dui));
  dui['A'] = 'A';
  dui['b'] = 'd';
  dui['d'] = 'b';
  dui['H'] = 'H';
  dui['I'] = 'I';
  dui['M'] = 'M';
  dui['O'] = 'O';
  dui['o'] = 'o';
  dui['p'] = 'q';
  dui['q'] = 'p';
  dui['T'] = 'T';
  dui['U'] = 'U';
  dui['V'] = 'V';
  dui['v'] = 'v';
  dui['W'] = 'W';
  dui['w'] = 'w';
  dui['X'] = 'X';
  dui['x'] = 'x';
  dui['Y'] = 'Y';
  j = len / 2;
  int ok = 1;
  if (len & 1) {
    for (i = 0; i <= j; ++i) {
      if (dui[s[j - i]] != s[j + i]) ok = 0;
    }
  } else {
    j--;
    for (i = 0; i <= j; ++i) {
      if (dui[s[j - i]] != s[j + i + 1]) ok = 0;
    }
  }
  puts(ok ? "TAK" : "NIE");
}