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
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using pr=pair<int, int>;
#define nl '\n'
#define st first
#define nd second
#define sz(x) (int)(x).size()
#define each(a, b) for(const auto& a:b)
#define rep(a, b) for(int a=0; a<(b); a++)
#define coz(x) cerr<<"("<<__LINE__<<") "<<(#x)<<": "<<(x)<<'\n'
#define cot(x, l, n) cerr<<"("<<__LINE__<<") "<<(#x)<<": "; \
for(int i=l; i<l+n; i++) { cerr<<x[i]<<' '; } cerr<<'\n'

int main() {
    cin.tie(nullptr)->sync_with_stdio(false);
    int n; 
    cin>>n;
    vector<pr> a;
    rep(i, n) {
        string s;
        int x;
        cin>>s>>x;
        if(s[0]=='N') continue;
        a.push_back({i+1, x});
    }
    rep(i, 10) {
        cout<<a[i].st<<' ';
    }
    int cnt=10;
    for(int i=10; cnt<20; i++) {
        if(a[i].nd>=2) continue;
        cnt++;
        cout<<a[i].st<<' ';
    }
    cout<<'\n';
}