A. Project Management
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output

There are $$$n$$$ employees in a company, where the $$$i$$$-th employee is of rank $$$a_i$$$. The company is launching a big project, which requires as many employees to join as possible. However, the employees are not fond of their colleagues with higher ranks. To make sure that all people in the project are willing to work together, for all $$$1 \le i \le n$$$, if the $$$i$$$-th employee is in the project, then there can only be at most $$$b_i$$$ people in the project with a rank larger than $$$a_i$$$.

As the boss of the company, you need to choose as many people as possible to join the project.

Input

There are multiple test cases. The first line of the input contains an integer $$$T$$$ ($$$1 \le T \le 10^4$$$), indicating the number of test cases. For each test case:

The first line contains an integer $$$n$$$ ($$$1 \le n \le 2 \times 10^5$$$), indicating the number of employees.

For the following $$$n$$$ lines, the $$$i$$$-th line contains two integers $$$a_i$$$ and $$$b_i$$$ ($$$1 \le a_i \le n$$$, $$$0 \le b_i \lt n$$$), indicating the rank of the $$$i$$$-th employee, and at most how many people with a higher rank he/she would like to work with.

It's guaranteed that the sum of $$$n$$$ of all test cases does not exceed $$$2 \times 10^5$$$.

Output

For each test case, first output one line containing one integer $$$c$$$, indicating the maximum number of people who can join the project. Then output one line containing $$$c$$$ distinct integers $$$p_1, p_2, \cdots, p_c$$$ separated by a space, indicating the indices of the employees to join the project. If there are multiple optimal answers, you can output any of them.

Example
Input
2
6
3 0
4 0
3 1
5 3
1 2
3 1
2
1 1
1 0
Output
3
6 3 4
2
1 2