The championship director Artem is constantly improving the testing system, making it more stable, efficient, and user-friendly.
This time, Artem has upgraded the team sorting system in the results table. To test his modification, Artem decided to run it on the results of one of the previous championships.
However, a problem arose — Artem only has the log of submissions, but he does not have the final ranking of the teams.
Help Artem — based on the available information about the teams' submissions, calculate the final results and their rankings.
Rules for Sorting Teams and Determining Rankings
The first line contains two integers $$$n$$$ and $$$p$$$ $$$(1 \le n \le 10^3; 1 \le p \le 20)$$$ — the number of teams and the number of problems in the competition.
The second line contains an integer $$$q$$$ $$$(1 \le q \le 10^5)$$$ — the number of submission records in the log.
In the $$$j$$$-th of the following $$$q$$$ lines, information about the $$$j$$$-th submission in the system is provided — four integers $$$M_j$$$, $$$ID_j$$$, $$$T_j$$$, and $$$V_j$$$ are given separated by spaces:
It is guaranteed that the submissions in the log are ordered chronologically, i.e., $$$M_j \le M_{j + 1}$$$ for all $$$1 \le j \lt q$$$.
This also means that even if $$$M_j = M_{j + 1}$$$, it should be considered that the $$$j$$$-th submission occurred before the $$$(j + 1)$$$-th.
In the $$$i$$$-th of $$$n$$$ lines, output four integers $$$R_i$$$, $$$ID_i$$$, $$$S_i$$$, $$$X_i$$$ separated by spaces:
5 32315 1 1 030 2 2 030 1 1 143 3 1 043 2 1 165 3 1 080 3 2 087 3 1 199 2 2 199 5 2 0100 1 2 0100 4 1 0130 1 2 0130 5 2 1130 2 3 0135 5 2 0140 5 3 1199 2 3 0200 4 3 0200 1 2 1280 4 2 0290 2 3 0299 2 3 1
1 2 3 521 2 1 2 290 2 5 2 290 4 3 1 127 5 4 0 0
First test example
A total of $$$5$$$ teams participated in the competition, and $$$3$$$ problems were available for solving.
In total:
| Name |
|---|


