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
38
39
40
#include <iostream>
#include <vector>
#include <algorithm>
#include <cassert>

using ll = long long;
#define debug(x) #x << " = " << x << '\n'

int main() {
  #ifdef LOCAL
    freopen("input.txt", "r", stdin);
  #endif
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(0);
  
	int n;
	std::cin >> n;

	int cnt = 0;

	for (int i = 1; i <= n; i++) {
		std::string s;
		std::cin >> s;
		int x;
		std::cin >> x;
		if (s == "TAK") {
			if (cnt < 10) {
				cnt++;
				std::cout << i << ' ';
			} else {
				if (cnt < 20 && x < 2) {
					cnt++;
					std::cout << i << ' ';
				}
			}
	  }
	}

  return 0;
}