COCI 2006/2007, Contest #5

Task NATRIJ

After an unsuccessful attempt at claiming power peacefully, Borko has decided to tear down Mirko's village hall, which was built for him out of cardboard by his loyal servants.

For this he will use Mirko's microprocessor (which was stolen from him by Borko's friend Zvonko), a bucket of water and a bag of sodium. He will enter the time of the "explosion" into the microprocessor, and it will drop the sodium in the water after the time is up.

Borko knows the current time and when he wants the explosion. He is not very fond of arithmetic and Zvonko is currently playing with marbles in his back yard so he can't help him.

Write a program that calculates the time to the explosion (this is the time Borko will enter into the microprocessor). The time Borko wants is at least one second and at most 24 hours.

Input

The first line of input contains the current time in hh:mm:ss format (hours, minutes, seconds). The hours will be between 0 and 23 (inclusive) and the minutes and seconds between 0 and 59.

The second line contains the time of the explosion in the same format.

Output

Output the desired time on a single line, in the same format as the times in the input.

Sample Tests

Input

20:00:00
04:00:00

Output

08:00:00

Input

12:34:56
14:36:22

Output

02:01:26

All Submissions
Best Solutions


Point Value: 5
Time Limit: 1.00s
Memory Limit: 32M
Added: Jul 13, 2013

Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

Comments (Search)

Given that it is specified that the output format matches the input format, I'm not sure how the output for test 9 is legal. The input format specifies that the hour is in [0, 23].

I am pretty sure by same format as input they meant display the result as hh:mm:ss,not follow the same restrictions on numbers. In the question it states that the time is at most 24 hours, so the answer has different parameters.

I am with sigkill on this one: how do we know that the required time of test 9 is supposed to refer to at least one day in the future and that is not today, same time?

Bah... Btw, changing a condition from "< 0" to "<= 0" solves it all, but I am still perplexed.

I agree with sigkill.
It clearly says "The hours will be between 0 and 23 (inclusive)".