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>

/*
Autor: Helena Borak-Wejster
*/
using namespace std;

const int bound = 3999990;

int main(){
    int n;
    cin >> n;
    if(n<bound){
        string s;
        cin >> s;
        int i=0;
        int j=s.size()-1;
        bool flag = true;
        while(i<j){
            if(s[i]!=s[j]) flag=false;
            i++;
            j--;
        }
        if(flag) cout << "TAK"<<endl;
        else cout << "NIE"<<endl;
    }
    else{
            cout << "TAK" << endl;
    }
    return 0;
}