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
#include <bits/stdc++.h>

using namespace std;
int a,l[201],p[201];
string b,c;
int main()
{
    cin >> a;
    cin >> b;
    cin >> c;
    for (int i = 0; i < a; i++)
    {
        if (i % 2 == 0)
        {
            l[b[i]]++;
            l[c[i]]--;
        }
        {
            p[b[i]]++;
            p[c[i]]--;
        }
    }
    for (int i = 0; i < 200; i++)
    {
        if (l[i] != 0 || p[i] != 0)
        {
            cout << "NIE\n";
            return 0;
        }
    }
    cout << "TAK\n";
    return 0;
}