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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include <iostream>

using namespace std;

int main()
{
    string pop[18]={"1A","2A","3A","4A","5A","5A","1B","2B","3B","4B","5B","5B","1C","2C","3C","4C","5C","5C"};
    int n=0; //od 1 do 100 ilosc pomyslow
    cin>> n;
    string tab[n], wejscie;
    for(int i=0;i<n;i++)
    {
        cin>>wejscie;
        tab[i]=wejscie;
    }
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<18;j++)
        {
            if(tab[i]==pop[j])
            {
                pop[j]="";
                break;
            }
        }
    }
    int spr=0;
    for(int j=0;j<18;j++)
        {
            if(pop[j]=="")
            {
                spr++;
            }
        }
    //sprawdzenie wyniku
    if(spr==18)
    {
        cout << "TAK";
    }else
    {
        cout << "NIE";
    }
    return 0;
}