1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
#include <bits/stdc++.h>

#define ll long long

int main() {
    std::ios::sync_with_stdio(false);
    using namespace std;
    map<string, int> A;
    int n;
    string tmp;
    cin >> n;
    while(n--) {
        cin >> tmp;
        A[tmp] += 1;
    }
    if(A.size() == 15 && A["5A"] >= 2 && A["5B"] >= 2 && A["5C"] >= 2)
        cout << "TAK\n";
    else
        cout << "NIE\n";
    return 0;
}