1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
from sys import stdin, stdout

n = int(stdin.readline())

output = []

accept_all = True
competitor_nr = 1
while len(output) < 20:
    is_eligible_str, past_nr_str = stdin.readline().split()
    if is_eligible_str == "NIE":
        competitor_nr += 1
        continue
    if not accept_all and int(past_nr_str) > 1:
        competitor_nr += 1
        continue
    output.append(competitor_nr)
    if len(output) >= 10:
        accept_all = False
    competitor_nr += 1

stdout.write(" ".join([str(i) for i in output]))