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 = INT_MAX;
const int NINF = INT_MIN;
const long long INF_LL = LLONG_MAX;
const long long NINF_LL = LLONG_MIN;
const double PI = acos(-1);
int main() {
  vector<bool> is_sym_up(26, false);
  is_sym_up['A' - 'A'] = true;
  is_sym_up['H' - 'A'] = true;
  is_sym_up['I' - 'A'] = true;
  is_sym_up['M' - 'A'] = true;
  is_sym_up['O' - 'A'] = true;
  is_sym_up['T' - 'A'] = true;
  is_sym_up['U' - 'A'] = true;
  is_sym_up['V' - 'A'] = true;
  is_sym_up['W' - 'A'] = true;
  is_sym_up['X' - 'A'] = true;
  is_sym_up['Y' - 'A'] = true;
  vector<bool> is_sym_lo(26, false);
  is_sym_lo['o' - 'a'] = true;
  is_sym_lo['v' - 'a'] = true;
  is_sym_lo['w' - 'a'] = true;
  is_sym_lo['x' - 'a'] = true;
  string str;
  getline(cin, str);
  int i = 0, j = str.length() - 1;
  bool is_sym = true;
  while (i <= j) {
    if (isupper(str[i]) != isupper(str[j])) {
      is_sym = false;
      break;
    }
    if (str[i] != str[j]) {
      if ((str[i] == 'p') and (str[j] == 'q')) {
      } else if ((str[i] == 'b') and (str[j] == 'd')) {
      } else if ((str[i] == 'q') and (str[j] == 'p')) {
      } else if ((str[i] == 'd') and (str[j] == 'b')) {
      } else {
        is_sym = false;
        break;
      }
    } else {
      bool is_up = isupper(str[i]);
      if (is_up) {
        if (!is_sym_up[str[i] - 'A']) {
          is_sym = false;
          break;
        }
      } else if (!is_sym_lo[str[i] - 'a']) {
        is_sym = false;
        break;
      }
    }
    ++i, --j;
  }
  if ((is_sym))
    puts("TAK");
  else
    puts("NIE");
  return 0;
}