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>

int main(){
	using namespace std;
	ios::sync_with_stdio(false), cin.tie(nullptr);
	
	int n;
	cin >> n;
	
	vector<pair<int, int>> a;
	for(int i = 0;i < n;i++){
		string s;
		int x;
		cin >> s >> x;
		if(s == "NIE") continue;
		a.emplace_back(i + 1, x);
	}

	assert((int)a.size() >= 20);
	for(int i = 0;i < 10;i++){
		cout << a[i].first << ' ';
	}
	
	int j = 10;
	int got = 0;
	while(got < 10){
		if(a[j].second >= 2){
			j += 1;
			continue;
		}
		got += 1;
		cout << a[j].first << ' ';
		j += 1;
	}
		
	return 0;
}