#131Easy
Sorting times
Time: 1 s · Memory: 256 MB
- Sorting
Statement
You are given moments of a day as hours, minutes and seconds. Sort them in non-decreasing order.
Input format
The first line contains (). Each of the next lines contains three integers: hours (), minutes and seconds ().
Output format
lines — the sorted moments in the same form as in the input (h m s, no leading zeros).
Examples
Input
4 10 20 30 7 30 0 23 59 59 13 30 30
Output
7 30 0 10 20 30 13 30 30 23 59 59
Note
Moments are compared by hours first, then by minutes, then by seconds. Use either a comparator with three keys or turn every moment into a single number — .
For an sort (bubble, selection) is too slow — use the built-in sort of your language.
Source: acmp.ru, problem 119.
