An ACM-style programming contest is run by judging software that accepts and evaluates each team's submissions (called runs) and shows the standings in a rank table. The scoring rules are:
Given the list of N runs, each with its submission time and result, produce the rank table for the C teams.
The input begins with two integers C and N. Then follow N runs, each given as four integers ci pi ti ri:
The numbers may be separated by spaces or line breaks.
Print the C team numbers on a single line, separated by single spaces, ordered from the best rank to the worst.