Market Research firm is carrying out a survey regarding popular brands. The person who has the best pulse of the survey population will be rewarded by the firm.
The survey comprises of N questions was taken by M participants, not at the same time but one after the other. Clearly, there is no correct answer since it is a survey of brands. Each question can have only four options (1,2,3,4). Most expected answers to different questions is used as a template to measure brand popularity. Think of this as a default answer sheet where the question paper is the Survey.
‘0’ represents no answer to a question. Thus it means that the participant has skipped answering that question.

Right Answer:

For a particular question, the highly chosen option till that point of time is treated as the correct answer. If multiple options have the same count, then out of those options the one which was chosen recently is treated as the right answer.
Score of a Participant:
One point will be awarded for each right answer. No negative points for wrong answers.

Instant Result:

This is shared to the Participant instantly after completion of his/her exam. (this is equal to number of right answers)

Final Result:

Only the final top scorer(TOPPER) is announced along with his score.

Note:

At the end of all M Participants completing the exam, the final right answers gets decided.
Based on these answers score of each candidate gets recalculated and the one with highest score is the TOPPER!!!
If more than one Participant gets the top score then the one among them who attempted the exam first, is treated as TOPPER.



Constraints

1 <= N,M <= 1000

Input Format

First line contains N (number of questions)
Second line contains M (number of Participants)
Third line contains N integers separated with space (default answers)
Next M lines contains N integers separated with space (response of M participants)

Output

First M lines showing the instant results of each Participant.
Last line containing the TOPPER’s id and his score
(assume id’s start with 1)

Test Case

Explanation

Example 1

Input

10
2
1 2 3 4 1 2 3 4 1 2
1 2 4 4 3 2 3 1 1 3
2 3 4 4 1 2 3 1 1 2

Output

6
6
1 8

Explanation

Number of questions = 10

Number of Participants = 2

Default answers : 1 2 3 4 1 2 3 4 1 2

(Latest Key is same as Default answers)

First Participant answers : 1 2 4 4 3 2 3 1 1 3

Right answers : 6 (= Instant result of first Participant)

Latest Key : 1 2 4 4 3 2 3 1 1 3

Second Participant’s answers : 2 3 4 4 1 2 3 1 1 2

Right answers : 6 (= Instant result of second Participant)

Latest Key : 1 2 4 4 1 2 3 1 1 2

Final key : 1 2 4 4 1 2 3 1 1 2

(Final Key is same as Latest Key at the end of all Participants completing the exam)

Right answers of Participant1 = Right answers of Participant2 = 8.

So topper is first Participant with score 8.