#P8071. Time Adjustment Problem

    ID: 21255 Type: Default 1000ms 256MiB

Time Adjustment Problem

Time Adjustment Problem

Given a time in 24-hour format denoted as $H:M$, compute and output the time that is exactly $45$ minutes earlier. The time is provided in the format "H:M" where H represents the hour and M represents the minute. Note that the result should also be in 24-hour format and the minute value should always be printed as two digits.

For example, if the input is 10:50, the output should be 10:05. If the input time is near midnight, such as 0:30, the output should correctly roll back to the previous day (23:45).

inputFormat

The input consists of a single line containing the time in 24-hour format H:M where H (0 ≤ H ≤ 23) and M (0 ≤ M ≤ 59) are integers.

outputFormat

Output the time that is exactly 45 minutes earlier than the input time in the same 24-hour format H:M. Ensure that the minute is always represented by two digits.

sample

10:50
10:05