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 <bits/stdc++.h>
using namespace std;

#define FOR(i,l,r) for(int i = (l); i <= (r); i++)
#define FORD(i,l,r) for(int i = (l); i >= (r); i--)

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin >> n;
    int g = 0;
    FOR(i,1,n){
        string s;
        int k;
        cin >> s >> k;
        if(s == "NIE") continue;
        if(g >= 10 and k >= 2) continue;
        if(g==20)continue;
        cout << i;
        if(g == 19) cout << '\n';
        else cout << ' ';
        g++;
    }
}