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

using i64 = long long;
using u64 = unsigned long long;
using u32 = unsigned;
using u128 = unsigned __int128;

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    
    int n;
    std::cin >> n;
    
    std::vector<int> ans;
    for (int i = 0; i < n; i++) {
        std::string s;
        int x;
        std::cin >> s >> x;
        
        if (s == "TAK" && ans.size() < 20) {
            if (ans.size() < 10 || x < 2) {
                ans.push_back(i + 1);
            }
        }
    }
    
    assert(ans.size() == 20);
    for (int i = 0; i < 20; i++) {
        std::cout << ans[i] << " \n"[i == 19];
    }
    
    return 0;
}