1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <iostream>
#include <vector>
using namespace std;

int main(){
    int n;
    cin >> n;
    vector<string> symbols= vector<string>({"1A","2A","3A","4A","5A", "5A","1B","2B","3B","4B","5B", "5B","1C","2C","3C","4C","5C", "5C"});
    for(int i=0; i<n; i++){
        string s;
        cin >> s;
        for(int j=0; j<symbols.size(); j++){
            if(symbols[j] == s){
                symbols.erase(symbols.begin()+j);
                break;
            }
        }
    }
    if(symbols.size() == 0){
        cout << "TAK";
    }else {
        cout<< "NIE";
    }
}