1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
#include <bits/stdc++.h>

using namespace std;

int main(){
	cin.tie(0)->sync_with_stdio(0);
	vector<int> ans;
	int n;
	cin >> n;
	for (int i = 1, x; i <= n; i++){
		string s;
		cin >> s >> x;
		if (s == "TAK" && ans.size() < 20){
			if (ans.size() < 10 || x < 2) ans.push_back(i);
		}
	}
	for (auto i : ans) cout << i << " ";
	cout << "\n";
	return 0;
}