1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
n = int(input())
numery = []
for i in range(n):
    wejscie = input().split()
    s = wejscie[0]
    x = int(wejscie[1])
    if s == "TAK" and len(numery)<10 or s == "TAK" and x < 2:
        numery.append(i+1)

    if len(numery) == 20:
        break

print(*numery)