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
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
using ll = long long;
#define all(x) x.begin(), x.end()
#define oset tree<ll, null_type, less_equal<ll>, rb_tree_tag, tree_order_statistics_node_update>

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0); 
    //ifstream cin("seating.in");
    //ofstream cout("seating.out");
    ll n; cin >> n;
    ll cnt = 0;
    for(int i = 1; i <= n; i++){
        if(cnt==20)break;
        string s; ll c; cin >> s >> c;
        if(s == "NIE")continue;
        else{
            if(cnt < 10){
                cnt++;
                cout << i << ' ';
            }else{
                if(c >= 2)continue;
                else{ cout << i << ' '; cnt++; }
            }
        }
    }
}