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
#include <iostream>
#include <algorithm>
#include <vector>

std::string a;
int b, c, d;
std::vector<short>v;
int n;
int k;

int main()
{
    std::cin.tie(0);
    std::cout.tie(0);
    std::ios_base::sync_with_stdio(0);
  std::cin >> n;
  for(int i=0; i<n; i++)
    {
        std::cin >> a >> b;
        if(c < 10 && a == "TAK")
        {
            v.push_back(i+1);
            c++;
        }
        else if(c >= 10 && b < 2 && a == "TAK")
        v.push_back(i+1);
    }
    for(int i=0; i<20; i++)
    {
        std::cout << v[i] << " ";
    }

}