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 str;
  bool ok;
  ok = true;
  long long int len, mid;
  cin >> str;
  mid = (str.length() / 2);
  len = str.length() - 1;
  if (str.length() % 2 == 1) {
    if (str[mid] == 'A' || str[mid] == 'H' || str[mid] == 'I' ||
        str[mid] == 'M' || str[mid] == 'O' || str[mid] == 'T' ||
        str[mid] == 'U' || str[mid] == 'V' || str[mid] == 'W' ||
        str[mid] == 'X' || str[mid] == 'Y' || str[mid] == 'o' ||
        str[mid] == 'v' || str[mid] == 'w' || str[mid] == 'x') {
      for (int i = 0; i < str.length() / 2; i++) {
        if (str[i] == 'A' || str[i] == 'H' || str[i] == 'I' || str[i] == 'M' ||
            str[i] == 'O' || str[i] == 'T' || str[i] == 'U' || str[i] == 'V' ||
            str[i] == 'W' || str[i] == 'X' || str[i] == 'Y' || str[i] == 'o' ||
            str[i] == 'v' || str[i] == 'w' || str[i] == 'x' || str[i] == 'b' ||
            str[i] == 'd' || str[i] == 'p' || str[i] == 'q') {
          if (str[i] == 'b') {
            if (str[len] == 'd') {
              ok = true;
            } else {
              ok = false;
              break;
            }
          } else if (str[i] == 'd') {
            if (str[len] == 'b') {
              ok = true;
            } else {
              ok = false;
              break;
            }
          } else if (str[i] == 'p') {
            if (str[len] == 'q') {
              ok = true;
            } else {
              ok = false;
              break;
            }
          } else if (str[i] == 'q') {
            if (str[len] == 'p') {
              ok = true;
            } else {
              ok = false;
              break;
            }
          } else if (str[i] == str[len]) {
            ok = true;
          } else {
            ok = false;
            break;
          }
        } else {
          ok = false;
          break;
        }
        len--;
      }
      if (ok == true)
        cout << "TAK" << endl;
      else
        cout << "NIE" << endl;
    } else
      cout << "NIE" << endl;
  } else {
    for (int i = 0; i < str.length() / 2; i++) {
      if (str[i] == 'A' || str[i] == 'H' || str[i] == 'I' || str[i] == 'M' ||
          str[i] == 'O' || str[i] == 'T' || str[i] == 'U' || str[i] == 'V' ||
          str[i] == 'W' || str[i] == 'X' || str[i] == 'Y' || str[i] == 'o' ||
          str[i] == 'v' || str[i] == 'w' || str[i] == 'x' || str[i] == 'b' ||
          str[i] == 'd' || str[i] == 'p' || str[i] == 'q') {
        if (str[i] == 'b') {
          if (str[len] == 'd') {
            ok = true;
          } else {
            ok = false;
            break;
          }
        } else if (str[i] == 'd') {
          if (str[len] == 'b') {
            ok = true;
          } else {
            ok = false;
            break;
          }
        } else if (str[i] == 'p') {
          if (str[len] == 'q') {
            ok = true;
          } else {
            ok = false;
            break;
          }
        } else if (str[i] == 'q') {
          if (str[len] == 'p') {
            ok = true;
          } else {
            ok = false;
            break;
          }
        } else if (str[i] == str[len]) {
          ok = true;
        } else {
          ok = false;
          break;
        }
        len--;
      } else {
        ok = false;
        break;
      }
    }
    if (ok == true)
      cout << "TAK" << endl;
    else
      cout << "NIE" << endl;
  }
  return 0;
}