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() {
  char ch[250];
  ch['A'] = 'A';
  ch['B'] = '.';
  ch['C'] = '.';
  ch['D'] = '.';
  ch['E'] = '.';
  ch['F'] = '.';
  ch['a'] = '.';
  ch['b'] = 'd';
  ch['c'] = '.';
  ch['d'] = 'b';
  ch['e'] = '.';
  ch['f'] = '.';
  ch['G'] = '.';
  ch['H'] = 'H';
  ch['I'] = 'I';
  ch['J'] = '.';
  ch['K'] = '.';
  ch['L'] = '.';
  ch['g'] = '.';
  ch['h'] = '.';
  ch['i'] = '.';
  ch['j'] = '.';
  ch['k'] = '.';
  ch['l'] = '.';
  ch['M'] = 'M';
  ch['N'] = '.';
  ch['O'] = 'O';
  ch['p'] = 'q';
  ch['Q'] = '.';
  ch['R'] = '.';
  ch['m'] = '.';
  ch['n'] = '.';
  ch['o'] = 'o';
  ch['P'] = '.';
  ch['q'] = 'p';
  ch['r'] = '.';
  ch['S'] = '.';
  ch['T'] = 'T';
  ch['U'] = 'U';
  ch['V'] = 'V';
  ch['W'] = 'W';
  ch['X'] = 'X';
  ch['s'] = '.';
  ch['t'] = '.';
  ch['u'] = '.';
  ch['v'] = 'v';
  ch['w'] = 'w';
  ch['x'] = 'x';
  ch['Y'] = 'Y';
  ch['Z'] = '.';
  ch['y'] = '.';
  ch['z'] = '.';
  string s;
  cin >> s;
  int l = s.size();
  int lll = s.size() / 2;
  for (int i = 0; i <= lll; i++) {
    if (s[i] != ch[s[l - 1 - i]]) {
      printf("NIE");
      return 0;
    }
  }
  if (l % 2 == 1) {
    if (s[lll] == 'A' || s[lll] == 'H' || s[lll] == 'I' || s[lll] == 'M' ||
        s[lll] == 'm' || s[lll] == 'O' || s[lll] == 'o' || s[lll] == 'T' ||
        s[lll] == 'U' || s[lll] == 'Y' || s[lll] == 'V' || s[lll] == 'v' ||
        s[lll] == 'W' || s[lll] == 'w' || s[lll] == 'X' || s[lll] == 'x')
      printf("TAK");
    else
      printf("NIE");
    return 0;
  }
  printf("TAK");
  return 0;
}