1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
import sys
n = int(input())
r = []

for x in range (1,n+1):
    command = input().split(" ")
    if len(r) >= 20:
        continue
    elif len(r) >= 10:
        if command[0] == "TAK" and int(command[1]) < 2:
            r.append(x)
    else:
        if command[0] == "TAK":
            r.append(x)

print(' '.join(str(x) for x in r))