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
40
#include <iostream>
using namespace std;
int n,tab1 [26], tab2[26];
string ciong1,ciong2;
bool wynik = 1;
int main()
{
    cin >> n;
    cin >> ciong1;
    cin >> ciong2;
    for (int i = 0; i < n; i += 2)
    {
        tab1[(int(ciong1[i]))%97]++;
        tab1[(int(ciong2[i]))%97]--;
    }
    for (int i = 1; i < n; i += 2)
    {
        tab2[(int(ciong1[i]))%97]++;
        tab2[(int(ciong2[i]))%97]--;
    }
    for (int i = 0; i < 26; i ++)
    {
        if (tab1[i] != 0)
        {
            wynik = 0;
            break;
        }
        else if (tab2[i] != 0)
        {
            wynik = 0;
            break;
        }
    }
    if (wynik)
    {
        cout << "TAK";
    }
    else
        cout << "NIE";
}