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
38
39
#include <bits/stdc++.h>
using namespace std;


int p1[26];
int n1[26];

int p2[26];
int n2[26];
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s1, s2;
    int n;
    cin>>n;
    cin>>s1;
    cin>>s2;

    for(int i =0;i<n;i++){
        if(i%2==0){
            p1[s1[i]-'a']++;
            p2[s2[i]-'a']++;
        }else{
            n1[s1[i]-'a']++;
            n2[s2[i]-'a']++;
        }
    }
    bool ok = true;
    for(int i = 0;i<26;i++) {
        if(p1[i]!=p2[i])ok = false;
        if(n1[i]!=n2[i])ok = false;
    }
    if(ok) {
        cout<<"TAK\n";
    }else{
        cout<<"NIE\n";
    }
    return 0;
}