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

int n, counter = 0;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    
    cin >> n;
    for(int i = 0; i < n; i++){
        string s;
        cin >> s;
        
        int c;
        cin >> c;
        
        if(s == "NIE") continue;
        
        if(counter < 10){
            cout << i + 1 << " ";
            counter++;
        } else {
            if(c < 2 && counter < 20){
                cout << i + 1 << " ";
                counter++;
            }
        }
    }

    return 0;
}