Sorting time#972

Sorting time

1 second
128 megabytes
Easy

Sort the given moments of time in non-decreasing order.

Input

The first line contains an integer (1 \leq n \leq 100). Each of the following lines contains three integers: hours (0 \leq h \leq 23), minutes (0 \leq m \leq 59), and seconds (0 \leq s \leq 59), representing a moment of time.

Output

Print the moments of time in non-decreasing order. Each moment should be printed as three integers (hours, minutes, seconds), separated by spaces, without leading zeros.

Examples

Example 1

Loading
Loading