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
41
42
43
44
45
46
47
48
49
50
51
#define _CRT_SECURE_NO_WARNINGS 1
#define _WINSOCK_DEPRECATED_NO_WARNINGS 1

#include <iostream>
#include <string>
using namespace std;



int colors1[2][50];
int colors2[2][50];
int main()
{
    int n;
    scanf("%d", &n);

    char c;
    scanf("%c", &c);
    for (int k = 0; k < 2; ++k)
    {
        string str;
        getline(std::cin, str);
        for (int i = 0; i < n; ++i)
        {
            char c = str[i];

            int j = c - 'a';
            if (i % 2 == 0)
            {
                colors1[k][j]++;
            }
            else
            {
                colors2[k][j]++;
            }
        }
     
    }

    for (int i = 0; i < 27; ++i)
    {
        if (colors1[0][i] != colors1[1][i] || colors2[0][i] != colors2[1][i])
        {
            printf("NIE");
            return 0;
        }
    }


    printf("TAK");
}