Problem C
Busy Schedule
You have a busy schedule to keep up with. Every time you make a new appointment, you scribble the starting time down on a little note pad. At the start of every day (12:00 a.m.), you sort the appointments for that day from earliest to latest and then go to sleep. Instead of having to be up at midnight every night to sort your appointments, you decide this would be a good job for your computer.
Input
Input contains at most
Output
For each test case, output the sequence of event starting times sorted from earliest to latest in the day, one per line. Format times in the same way as the input. Separate adjacent test case outputs with a blank line.
Sample Input 1 | Sample Output 1 |
---|---|
5 3:00 a.m. 3:00 p.m. 12:00 a.m. 11:59 a.m. 12:00 p.m. 3 3:30 p.m. 9:30 a.m. 3:30 p.m. 0 |
12:00 a.m. 3:00 a.m. 11:59 a.m. 12:00 p.m. 3:00 p.m. 9:30 a.m. 3:30 p.m. 3:30 p.m. |