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
#include <bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    vector<int>ans;
    int l = 0;
    for(int i = 0;i<n;i++){
        string a;
        int b;
        cin >> a >> b;
        if(l<10&&a=="TAK"){
            ans.push_back(i+1);
            l++;
        }
        else if(l<20&&a=="TAK"){
            if(b<2){
                l++;
                ans.push_back(i+1);
            }
        }

    }
    for(auto x:ans)
        cout << x << ' ';
    return 0;
}