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
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<vii> vvii;
typedef vector<bool> vb;
typedef vector<vb> vvb;
#define ALL(x) begin(x), end(x)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define printBool(x) cout << ((x) ? "YES\n" : "NO\n")
#define printBoolR(x) {cout << ((x) ? "YES\n" : "NO\n"); return;}
inline ll nxt(){ll x;cin>>x;return x;}
#define fill_i(x) generate(ALL(x), nxt)

void testCase(int caseNr) {
    int n; cin >> n;

    int j = 0;
    for (int i = 0; i < n; i++) {
        string s; int f; cin >> s >> f;
        if (s == "TAK" && j < 20) {
            if (j >= 10 && f >= 2) continue;
            cout << i+1 << ' ';
            j++;
        }
    }
}

int main() {
    // freopen("input", "r", stdin);
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    // int T; cin >> T; for (int t = 1; t <= T; t++) testCase(t);
    testCase(0);
    return 0;
}