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

auto main()->int{
    int n, a;
    cin >> n;
    int cnt = 0;
    string x;
    for(int i = 1; i <= n and cnt < 20; i++){
        cin >> x >> a;
        if(x == "TAK"){
            if(cnt < 10){
                cout << i << ' ';
                cnt++;
            }
            else{
                if(a < 2){
                    cout << i << ' ';
                    cnt++;
                }
            }
        
        }
    }
    return 0;
}