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;
int main(){
    int n;
    cin>>n;
    vector<pair<int, int> > data;
    for(int i=0; i<n; i++){
        string a;
        int c;
        cin>>a>>c;
        if(a[0]=='T') data.push_back(make_pair(i+1, c)); 
    }
    for(int i=0; i<10; i++){
        cout<<data[i].first<<' ';
    }
    int it=0, j=10;
    while(it<10){
        if(data[j].second<2){
            cout<<data[j].first<<' ';
            it++;
        } 
        j++;
    }
    return 0;
}