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
32
33
34
35
36
37
#include <bits/stdc++.h>

typedef long long ll;

using namespace std;

int n,akt=0;
char x;
char S[400000];


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie();
    cout.tie();
    cin >> n;
    int i=0;
    while(cin>>x){
        S[i++]=x;
        if(i==400000){
            cout << "NIE"<<endl;
            return 0;
        }
    }

    for(int j=0; j<=(i-1)/2; j++){
        if(S[j]!=S[i-j-1]){
            cout << "NIE"<<endl;
            return 0;
        }
    }
    cout << "TAK"<<endl;


    return 0;
}