1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <iostream>

using namespace std;

int n;
bool pali (string &s)
{
    int p=0;
    int k=s.size()-1;
    while (p<k)
    {
        if (s[p]!=s[k])
            return 0;
        ++p;
        --k;
    }
    return 1;
}
string s;
int main()
{
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(0);
    cin >>n >> s;
    if (pali (s))
    cout << "TAK";
    else
        cout << "NIE";
    return 0;
}