

People lost their jobs during the great depression. In that time, people didn’t care about anything except power and money. They also used both to control another one. If some one's power and money are both less than yours, then you can control him. We have some data of many people. For every one, please compute how many people he can control.
The first line of the input is an integer Z (Z ≤ 10), which means the number of test cases.
For each test case, one line contains one positive integer N (N ≤ 105).
There are N lines following. For each line, there are two integers Pi, Mi (|Pi|, |Mi| ≤ 106).
For each test case, output the test case number in the first line, and then N lines follows.
Every line contains one integer representing the number of the people the person can control. Output one blank line between every two test cases.