Time limit
1s
Memory limit
128 MB
KOI Electronics is developing an AI oven that makes smoked duck easy to cook. The user puts a suitable amount of smoked duck ingredients into the oven and starts cooking. The oven then calculates, in seconds, when cooking will finish.
A digital clock on the front of the oven shows the time when cooking is done. Given the starting time and the required cooking time in seconds, write a program that calculates the finishing time.
The first line gives the current time in the form A B C. A is the hour, B is the minute, and C is the second, where 0 <= A <= 23, 0 <= B <= 59, and 0 <= C <= 59.
The second line gives the cooking time D in seconds, where 0 <= D <= 500000.
Print the hour, minute, and second of the finishing time, separated by spaces.
The hour must be an integer from 0 to 23, and the minute and second must be integers from 0 to 59. The digital clock changes from 23 59 59 to 0 0 0 after one second.