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;
double pi = 2 * acos(0.0);
const int INF = 1e9 + 7;
bool isleap(int y) {
  if (y % 400 == 0 || (y % 4 == 0 && y % 100 != 0))
    return true;
  else
    return false;
}
void WetPitch() {
  set<char> st;
  st.insert('A');
  st.insert('H');
  st.insert('I');
  st.insert('M');
  st.insert('O');
  st.insert('o');
  st.insert('T');
  st.insert('U');
  st.insert('V');
  st.insert('v');
  st.insert('W');
  st.insert('w');
  st.insert('X');
  st.insert('x');
  st.insert('Y');
  string s;
  cin >> s;
  int n = s.length();
  bool flag = false;
  if (n % 2 != 0) flag = true;
  int tc = n / 2 + (n % 2 != 0);
  for (int i = 0; i < tc; i++) {
    if (flag && i == n - 1) {
      if (st.find(s[i]) != st.end()) {
        break;
      }
    }
    if ((st.find(s[i]) != st.end() && s[i] == s[n - i - 1]) ||
        (s[i] == 'b' && s[n - i - 1] == 'd' ||
         (s[i] == 'd' && s[n - i - 1] == 'b') ||
         (s[i] == 'q' && s[n - i - 1] == 'p') ||
         (s[i] == 'p' && s[n - i - 1] == 'q'))) {
      continue;
    } else {
      cout << "NIE" << endl;
      return;
    }
  }
  cout << "TAK" << endl;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int tst;
  tst = 1;
  while (tst--) {
    WetPitch();
  }
  return 0;
}