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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <numeric>
#include <stack>
using namespace std;
using ll = long long int;
#define debug(x) cout << #x << " = " << x << endl;
void solve()
{
    vector<int>odp(20);
    int n;
    cin >> n;
    vector<pair<string, int>>dane(n);
    for (int i = 0; i < n; i++)
    {
        cin >> dane[i].first >> dane[i].second;
    }
    int finalisci = 0;
    int indeks = 0;
    while (finalisci < 20)
    {
        if (dane[indeks].first != "NIE")
        {
            if (finalisci < 10)
            {
                odp[finalisci] = indeks;
                finalisci++;
            }
            else
            {
                if (dane[indeks].second <= 1)
                {
                    odp[finalisci] = indeks;
                    finalisci++;
                } 
            }
        }
        indeks++;
    }
    for (int i = 0; i < 20; i++)
    {
        cout << odp[i] + 1  << " ";
    }
}

int main()
{
    ios::sync_with_stdio(false);
    //int t;
    //cin >> t;
    //while (t--)
    //{
        solve();
    //}
    return 0;
}