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