#P10409. 24-Hour to 30-Hour Clock Conversion

    ID: 12418 Type: Default 1000ms 256MiB

24-Hour to 30-Hour Clock Conversion

24-Hour to 30-Hour Clock Conversion

Little R, a cute girl, once encountered a deadline issue when she submitted her homework at 23:00 only to find out that the deadline was at midnight (00:00). To avoid such mishaps, she introduces the "30-hour clock".

The 30-hour clock still represents a day as 24 hours, but the time range of a day is shifted. Instead of the normal range of 00:00 to 23:59 used in the 24-hour clock, the 30-hour clock uses the range 06:00 to 29:59. The conversion rule is as follows:

Let the time in the 24-hour clock be given as \(HH:MM\). Then:

  • If \(06 \le HH \le 23\), the time remains the same.
  • If \(0 \le HH \le 5\), then the 30-hour clock time is \((HH+24):MM\).

For example, the following illustrates the mapping between the two formats:

24-hour clock 30-hour clock
06:00 06:00
12:00 12:00
18:00 18:00
00:00 24:00
05:59 29:59
06:00 (next day) 06:00 (corresponding day)

Note: Since Little R finds leap year handling troublesome, you only need to output the converted time without worrying about the date.

inputFormat

The input contains a single line with a time in 24-hour format HH:MM (e.g., 00:00, 06:00, 23:59).

outputFormat

Output the corresponding time in the 30-hour format. If the given time is between 00:00 and 05:59, add 24 to the hour portion (i.e., \(HH+24\)) and print the result in the format HH:MM.

sample

06:00
06:00