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;
void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }
template <typename T, typename V>
void __print(const pair<T, V> &x) {
  cerr << '{';
  __print(x.first);
  cerr << ',';
  __print(x.second);
  cerr << '}';
}
template <typename T>
void __print(const T &x) {
  int f = 0;
  cerr << '{';
  for (auto &i : x) cerr << (f++ ? "," : ""), __print(i);
  cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v)) cerr << ", ";
  _print(v...);
}
const long double PI = acos(-1.0);
long long int power(long long int x, long long int y) {
  long long int res = 1;
  x = x;
  while (y > 0) {
    if (y & 1) res = (res * x);
    y = y >> 1;
    x = (x * x);
  }
  return res;
}
long long int power(long long int x, long long int y, long long int p) {
  long long int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long int gcd(long long int a, long long int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
map<char, char> mm;
bool isPalindrome(string str) {
  long long int l = 0;
  long long int h = str.length() - 1;
  while (h >= l) {
    ;
    if (mm[str[l++]] != str[h--]) {
      ;
      return false;
    }
  }
  return true;
}
void solve() {
  string s;
  cin >> s;
  if (isPalindrome(s)) {
    cout << "TAK" << endl;
    return;
  }
  cout << "NIE" << endl;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  for (long long int i = 65; i <= 90; i++) {
    mm[(char)i] = '?';
  }
  for (long long int i = 97; i <= 97 + 25; i++) {
    mm[(char)i] = '?';
  }
  mm['A'] = 'A';
  mm['b'] = 'd';
  mm['d'] = 'b';
  mm['H'] = 'H';
  mm['I'] = 'I';
  mm['M'] = 'M';
  mm['O'] = 'O';
  mm['o'] = 'o';
  mm['p'] = 'q';
  mm['q'] = 'p';
  mm['T'] = 'T';
  mm['U'] = 'U';
  mm['V'] = 'V';
  mm['v'] = 'v';
  mm['W'] = 'W';
  mm['w'] = 'w';
  mm['X'] = 'X';
  mm['Y'] = 'Y';
  mm['x'] = 'x';
  ;
  long long int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}