1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <iostream>

int main(void)
{
	unsigned int	n;
	unsigned int	x;
	unsigned int	q = 0;
	std::string		s;
	std::cin >> n;
	for (unsigned int row = 0; row < n; row++)
	{
		std::cin >> s >> x;
		if (s == "TAK" && (q < 10 || x < 2))
		{
			std::cout << row + 1 << ' ';
			q++;
		}
		if (q == 20)
			break;
	}
	std::cout << std::endl;
	return 0;
}