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;
template <typename T>
T nextInt() {
  T x = 0, p = 1;
  char ch;
  do {
    ch = getchar();
  } while (ch <= ' ');
  if (ch == '-') {
    p = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + (ch - '0');
    ch = getchar();
  }
  return x * p;
}
const int maxN = (int)1e6 + 10;
const int INF = (int)1e9 + 5;
const int mod = (int)1e9 + 7;
const long long LLINF = (long long)1e18 + 5;
char ok[257];
void make(string s) {
  for (auto x : s) ok[x] = true;
}
void bad() {
  cout << "NIE\n";
  exit(0);
}
bool OK(char a, char b) {
  if (a == 'b' && b == 'd') return true;
  if (b == 'b' && a == 'd') return true;
  if (a == 'p' && b == 'q') return true;
  if (b == 'p' && a == 'q') return true;
  return a == b && ok[a];
}
int main() {
  make("AHIMOoTUVvWwXxY");
  string s;
  cin >> s;
  int n = s.length();
  for (int i = 0; i < n / 2; ++i) {
    if (!OK(s[i], s[n - i - 1])) bad();
  }
  if (n % 2 == 1 && !ok[s[n / 2]]) {
    bad();
  }
  cout << "TAK\n";
  return 0;
}