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;
const long double eps = 0.000000001;
const double pi = 3.141592653589;
const long long mod = 1000000007;
long long gcd(long long a, long long b) {
  if (a > b) swap(a, b);
  while (a != 0 && b != 0) {
    b %= a;
    swap(a, b);
  }
  return a + b;
}
long long poww(long long v, long long p) {
  if (p == 0) return 1;
  if (p & 1) {
    return (poww(v, p - 1) * v) % mod;
  } else {
    long long t = poww(v, p / 2);
    return (t * t) % mod;
  }
}
void calc_primes(int n, vector<bool> &primes) {
  primes.resize(n, true);
  primes[1] = false;
  for (int i = 2; i * i < n; ++i) {
    if (!primes[i]) continue;
    for (int j = i * i; j < n; j += i) {
      primes[j] = false;
    }
  }
}
long long ext_gcd(long long a, long long b, long long &x, long long &y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  long long x1, y1;
  long long d = ext_gcd(b % a, a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
  return d;
}
bool vect_comp(pair<int, int> a, pair<int, int> b) {
  return (a.first * b.second - a.second * b.first > 0);
}
bool get_bit(int &v, char &num) { return ((v >> num) & 1); }
void set_bit(int &v, const char &num) { v = v | (1 << num); }
int count_bit(int v) {
  int cnt = 0;
  while (v > 0) {
    cnt += v & 1;
    v = v >> 1;
  }
  return cnt;
}
long long n, m, k, k0;
int res = 0;
int u, v;
string st;
int cur = 0, mx = 0;
vector<int> arr;
char symbs[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
char vidp[] = "A111111HI111M1O1111TUVWXY11d1b1111111211oqp1111vwx11";
map<char, char> V;
void solve() {
  cin >> st;
  int sz1 = strlen(symbs);
  for (int i = (0); i < (sz1); ++i) {
    V[symbs[i]] = vidp[i];
  }
  for (int i = (0); i < (st.size()); ++i) {
    if (st[i] == V[st[st.size() - i - 1]]) continue;
    cout << "NIE";
    return;
  }
  cout << "TAK";
  return;
}
int main() {
  solve();
  return 0;
}