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
41
42
43
44
45
46
47
48
49
#include <bits/stdc++.h>
using namespace std;

#ifdef DEBUG
#include "debug.hpp"
#else
#define debug(...) (void)0
#endif

namespace R = ranges;
namespace V = views;
auto ra(auto x, auto y) { return R::iota_view(x, y); }
auto rae(auto x, auto y) { return ra(x, y + 1); }
using i64 = int64_t;

void solve() {
  int n;
  cin >> n;

  int already = 0;
  for (auto i : rae(1, n)) {
    string s;
    int x;
    cin >> s >> x;
    if (s == "NIE") {
      continue;
    }
    if (s == "TAK" and (x < 2 or (x >= 2 and already < 10))) {
      already += 1;
      cout << i << " ";
    }

    if (already == 20) {
      break;
    }
  }
  cout << endl;
}

int32_t main() {
  cin.tie(nullptr)->sync_with_stdio(false);
  int t = 1;
  // cin >> t;
  for (auto tc_n : ra(0, t)) {
    debug(tc_n);
    solve();
    cout.flush();
  }
}