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>
using namespace std;

map<string, int> container;

int main()
{
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++)
    {
        string s;
        cin >> s;
        container[s]++;
    }

    if (container.size() == 15 and container["5A"] >= 2 and container["5B"] >= 2 and container["5C"] >= 2)
        cout << "TAK";
    else
        cout << "NIE";
}