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;
char chr[] = "HIOoTUMAVvWwxXY";
bool check(char c1, char c2) {
  if (c1 == 'b' && c2 == 'd' || c1 == 'd' && c2 == 'b') {
    return true;
  } else if (c1 == 'p' && c2 == 'q' || c1 == 'q' && c2 == 'p') {
    return true;
  }
  for (int i = 0; i < 15; i++) {
    if (c1 == chr[i] && c2 == chr[i]) return true;
  }
  return false;
}
int main(void) {
  int mid, len;
  string s;
  cin >> s;
  bool b = false;
  len = s.length();
  mid = len / 2;
  if (len % 2 == 0) {
    for (int i = 0; i < mid; i++) {
      if (check(s[i], s[(len - i) - 1]) == false) {
        cout << "NIE";
        return 0;
      }
    }
  } else {
    for (int i = 0; i < 15; i++) {
      if (s[mid] == chr[i]) {
        b = true;
      }
    }
    if (b == false) {
      cout << "NIE";
      return 0;
    }
    for (int i = 1; i <= mid; i++) {
      if (check(s[mid - i], s[mid + i]) == false) {
        cout << "NIE";
        return 0;
      }
    }
  }
  cout << "TAK";
  return 0;
}