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 long maxn = (1e6) + 11;
const int MOD = (1e9) + 7;
const long long INF = (1e10) + 777;
const long double pi = 2 * acos(0.0);
const long long E9 = 1e9;
const long long E8 = 1e8;
const long long E7 = 1e7;
const long long E6 = 1e6;
const long long E5 = 1e5;
const long long E4 = 1e4;
const long long E3 = 1e3;
long long toup(long long n, int div) {
  return n % div == 0 ? (n / div) : ((n + (div - n % div)) / div);
}
long long n, m, k, cnt = 0, sum, cnt1 = 0, tt[maxn], a[maxn];
string s1, t, s2, s;
long long x, y, x2, y2;
set<char> second;
long long mx = 0;
long long dp[1000004];
vector<pair<long long, long long>> ans;
map<char, char> mm;
void solve() {
  cin >> s;
  mm['d'] = 'b';
  mm['b'] = 'd';
  mm['A'] = 'A';
  mm['H'] = 'H';
  mm['I'] = 'I';
  mm['M'] = 'M';
  mm['O'] = 'O';
  mm['o'] = 'o';
  mm['T'] = 'T';
  mm['U'] = 'U';
  mm['q'] = 'p';
  mm['p'] = 'q';
  mm['V'] = 'V';
  mm['v'] = 'v';
  mm['W'] = 'W';
  mm['w'] = 'w';
  mm['X'] = 'X';
  mm['x'] = 'x';
  mm['Y'] = 'Y';
  n = s.size();
  if (n == 1 && mm[s[0]] == NULL) {
    cout << "NIE";
    return;
  }
  if (n == 1 && mm[s[0]] == s[0]) {
    cout << "TAK";
    return;
  }
  if (n == 1) {
    return;
  }
  for (int i = 0, j = n - 1; i < j; ++i, --j) {
    if (mm[s[i]] == s[j]) {
      cnt++;
    }
  }
  char c = 'x';
  if (n % 2 == 1) {
    n--;
    n /= 2;
    c = s[n];
  } else {
    n /= 2;
  }
  if (cnt == n && ((mm[c] == c && s.size() % 2 == 1) || s.size() % 2 == 0)) {
    cout << "TAK";
    return;
  }
  cout << "NIE";
}
int main() {
  int test = 1;
  while (test--) {
    solve();
  }
}