1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
#include<bits/stdc++.h>
using namespace std;
set<string> s;
int n, a = 0, b = 0, c = 0;
int main(){
    cin >> n;
    for (int i = 0; i < n; i++){
        string x;
        cin >> x;
        s.insert(x);
        if (x == "5A") a++;
        if (x == "5B") b++;
        if (x == "5C") c++;
    }
    if (s.size() == 15 && a >= 2 && b >= 2 && c >= 2) cout << "TAK" << endl;
    else cout << "NIE" << endl;
}