#K93937. Organize Participant Scores

    ID: 38530 Type: Default 1000ms 256MiB

Organize Participant Scores

Organize Participant Scores

You are given a list of participant entries, where each entry contains a participant ID and a score. Your task is to organize these entries so that they are sorted in ascending order by the participant ID, and for the same participant ID, the scores are sorted in ascending order.

The sorting criteria can be mathematically expressed as follows: [ (a, b) \prec (c, d) \iff a < c \quad \text{or} \quad (a = c \text{ and } b < d), ] where ((a, b)) and ((c, d)) represent two entries with participant IDs and scores respectively.

Read the input from standard input (stdin) and output the result to standard output (stdout).

inputFormat

The input is read from stdin. The first line contains an integer (n) representing the number of entries. Each of the following (n) lines contains two space-separated integers: the participant ID and the score.

outputFormat

Output the sorted list of entries to stdout. Each line should contain two integers (participant ID and score) separated by a space, following the required sort order: primarily by participant ID in ascending order and then by score in ascending order.## sample

1
100 250
100 250

</p>