Every year in Byteland an Annual Programming Contest is held.
The contest has two parts: qualifications and final. The qualifications are boring
so I won't waste your precious time for describing it. Worth mentioning is only the fact,
that finalists keep points gathered during the qualifications.
The final is divided into several rounds, after each of them one winner is announced.
In each round participants' task is to write a program (always a different program)
as fast as possible. Only first 5 contestants receive points (1st - 15 points, 2nd -
9, 3rd - 5, 4th - 2, 5th - 1), which they add to points gathered in previous rounds
and qualifications. After that, a person with the greatest amount of points (from
all the participants left in the contest) is announced a winner; if there is more than
one such person the one with a lower number wins. The winner does not take part
in the rest of the contest.
First line of input contains the number of years the contest already has been held.
For each year a situation in the final is described.
Description of each final starts with integers N - number of contestants, and
R - number of rounds (5<=N<=20.000, 1<=R<=N-4).
Then for each participant there is given amount of points gathered in qualifications
(it's a non-negative integer). And after that, all the R rounds are described.
Description
of a round consists of numbers of five contestants (they are numbered starting with 1)
who first wrote their program; they are ordered by increasing time.
For each year output in one line the winners (i.e. their numbers) of the contest in order they were being announced.
3 5 1 1 1 1 1 1 1 2 3 4 5 10 1 1 3 5 7 9 11 13 15 17 19 1 2 3 4 5 10 3 1 3 5 7 9 11 13 15 17 19 1 2 3 4 5 5 6 7 8 9 1 2 3 4 6
1 10 10 5 1