Two weeks have passed since the presidential election and the result still has not been announced. Instead of waiting, Seongje decided to work out the winner himself.
By some means of his own, Seongje surveyed every single person who voted and recorded how each of them ranks the candidates. A voter always votes according to that ranking.
For example, suppose there are 5 candidates and one voter's ranking is [3, 2, 5, 1, 4]. If candidate 2 and candidate 4 face each other, this voter votes for candidate 2, because 2 comes before 4 in the ranking.
The voting rules are as follows.
From the rankings Seongje collected, find the final winner and the round in which that candidate was elected.
The first line contains the number of test cases T. (1≤T≤100)
The first line of each test case contains the number of candidates C and the number of voters V. (1≤C,V≤100, and V is odd)
Each of the next V lines contains C integers, the ranking of one voter. The candidate written first is the most preferred one and the candidate written last is the least preferred one.
The C integers on one line contain every integer from 1 to C exactly once.
For each test case, print the number of the elected candidate and the round in which the voting ended (1 or 2) on one line, separated by a space.