1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <iostream>
using namespace std;
string tab[18]={"1A", "1B", "1C", "2A", "2B", "2C", "3A", "3B", "3C", "4A", "4B", "4C", "5A", "5A", "5B", "5B", "5C", "5C"};
int main ()
{
	int n, wynik=0;
	int rozmiarTab = 18;
	
	cin >> n;
	for (int i=0; i<n; i++)
	{
		string slowo;
		cin >> slowo;
		
		for (int j=0; j<rozmiarTab; j++)
		{
			if (slowo == tab[j])
			{
				wynik++;
				tab[j] = "0";
				break;
			}
		}
	}
	
	if (wynik == 18)
		cout << "TAK" << endl;
	else if (wynik < 18)
		cout << "NIE" << endl;
}