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

int main() {
    cin.tie(0)->sync_with_stdio(false);

    int n, cnt1 = 0, cnt2= 0;

    cin >> n;
    for(int i = 1; i <= n; i++) {
        string x;
        int y;
        cin >> x >> y;
        if(x == "NIE")continue;
        if(cnt1 < 10) {
            cout << i << " ";
            cnt1++;
        }
        else if(cnt2 < 10 && y < 2) {
            cout << i << " ";
            cnt2++;
        }
    }
}