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
#include <bits/stdc++.h>
using namespace std;
int main(){
	ios_base::sync_with_stdio(0);cin.tie();
	int n; cin >> n;

	vector<int> f10,s10;
	string wantsfinal; int finalcount;
	for(int x=1;x<=n;x++){
		cin >> wantsfinal >> finalcount;
		if(wantsfinal=="TAK"){
			if(f10.size()==10){
				if(finalcount<2){
					s10.push_back(x);
				}
			}
			else{
				f10.push_back(x);
			}
		}
	}

	for(int x=0;x<10;x++){
		cout << f10[x] << ' ';
	}
	for(int x=0;x<10;x++){
		cout << s10[x] << ' ';
	}
}