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
#include <bits/stdc++.h>
#define int long long
#define pii pair<int, int>
#define piii pair<pair<int,int>, int>
#define st first.first
#define nd first.second
#define rd second
#define For(i, l, r) for (int i = l; i <= r; i++)
#define Forcin(l, r, a)        \
  for (int i = l; i <= r; i++) \
    cin >> a[i];
#define Ford(i, l, r) for (int i = l; i >= r; i--)
#define ben(v) v.begin(), v.end()
#define LOCAL 0
#define LOCAL2 0
using namespace std;
 
const int M = 400005, inf=1e9;
int n, w=0;

void wez(int x){
    cout << x<<' ';
    w++;
}
 
signed main()
{
  //cin.tie(0)->sync_with_stdio();
    if (LOCAL)
        freopen("a.txt", "r", stdin);
    if (LOCAL2)
        freopen("local_out.txt", "w", stdout);
    cin>>n;
    For(i, 1, n){
        string a;
        int b;
        cin>>a>>b;
        if (a=="TAK" && w < 20 && (b<2 || w<10))
            wez(i);
    }
}