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