Yazmonkey loves to drink banana milk, he drinks it whenever he is stressfull or he needs his brain power.
Now, there are N groups of programmers are seeking for Yazmonkey's help since it is expert in debugging. Yazmonkey will first help the group of programmers that give the most banana milk to him. Can you help Yazmonkey to find out the order that it is going to help?
Every person in a group will carry a few cartons of banana milk, Yazmonkey is going to help the group that give it the most amount of banana milk, if there are some groups that carry same amount of banana milk, Yazmonkey will first help the group that the person who gives the most amount of banana milk among these groups belong to. If they're still the same, Yazmonkey will first help the group with more people, if they're still the same, Yazmonkey will help them according to the input order.
The first line of input contains one integers T (1 ≤ T ≤ 5), representing the number of test cases.
For each test case, first line of input contains one integer (1 ≤ N ≤ 2000), representing the number of group.
Next input N lines, each line first input a integer Ki (1 ≤ Ki ≤ 1000000), representing the number of people in this group, and then input Ki integer Aij(1 ≤ Aij ≤ 1000000), representing the quantity of banana milk that each person gives.
Guarantee that for each testcase, there are at most 1000000 persons, that is, sum of Ki is less than or equal to 1000000.
Output the group info(how many banana milk does each person gives with the order that Yazmonkey is going to help.
Remember to output '\n' at the end of every line.