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
//
// Created by Kacper Filipiak on 09.12.2020.
//
#include <iostream>
int main(){
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(NULL);
    int n;
    char ch;
    bool is_in_place;
    std::cin>>n;
    char origin_array[n];
    for(int i = 0; i < n; i++){
        std::cin>>origin_array[i];
    }
    for(int i = 0; i < n; i++){
        std::cin>> ch;
        is_in_place = false;
        for(int t = i % 2; t < n; t += 2){
            if(ch == origin_array[t]){
                is_in_place = true;
                origin_array[t] = ' ';
                break;
            }
        }
        if (!is_in_place) {
            std::cout<<"NIE";
            return 0;
        }
    }
    std::cout<<"TAK";
    return 0;
}