Time Sorting#350

Time Sorting

1 second
128 megabytes
Very easy (≈850)

Sort the times according to the given criteria.

Input

The first input is the number n~(1 \le n \le 100) which is followed by time moments. Each time moment is given as integer values — hours (from to ), minutes (from to ), and seconds (from to ).

Output

Output the time moments in non-decreasing order (in the format of hours, minutes, and seconds as in the input, without leading zeros).

Examples

Example 1

Loading
Loading