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 m[15] = {'x', 'o', 'X', 'O', 'A', 'H', 'I', 'M',
              'T', 'U', 'V', 'v', 'W', 'w', 'Y'};
int main() {
  string s;
  cin >> s;
  int n = s.size();
  int f = 1;
  if (n % 2 != 0) {
    for (int i = 0; i < 15; i++) {
      if (s[(n / 2)] == m[i]) {
        f = 1;
        break;
      } else {
        f = 0;
      }
    }
  }
  if (f == 1) {
    for (int i = 0; i < (n / 2); i++) {
      if (s[i] == s[n - 1 - i]) {
        for (int j = 0; j < 15; j++) {
          if (s[i] == m[j]) {
            f = 1;
            break;
          } else {
            f = 0;
          }
        }
        if (f == 0) break;
      } else {
        if ((s[i] == 'b' && s[n - 1 - i] == 'd') ||
            (s[i] == 'd' && s[n - 1 - i] == 'b') ||
            (s[i] == 'p' && s[n - 1 - i] == 'q') ||
            (s[i] == 'q' && s[n - 1 - i] == 'p')) {
          f = 1;
        } else {
          f = 0;
          break;
        }
      }
    }
  }
  if (f == 0)
    cout << "NIE" << endl;
  else
    cout << "TAK" << endl;
  return 0;
}