1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#include <iostream>
#include <map>
#include <string>

using namespace std;

int main()
{
    int n;
    string s;
    map<string, int> m;
    cin >> n;
    while(n--) {
        cin >> s;
        m[s]++;
    }
    if(m.size() > 14 && m["5A"] > 1 && m["5B"] > 1 && m["5C"] > 1) cout << "TAK\n";
    else cout << "NIE\n";
}