cho.sh
Notes
Loading...

Oven Clock

Time limit

1s

Memory limit

128 MB

Problem

An electronics company has made a smart oven that tells the user when cooking will finish. After the ingredients are placed in the oven and the cooking time is set, the oven calculates the finishing time in minutes.

Given the time when cooking starts and the number of minutes needed to cook, write a program that prints the time when cooking ends.

Input

The first line contains the current time: hour A and minute B, separated by a space. A is an integer from 0 to 23, and B is an integer from 0 to 59.

The second line contains C, the cooking time in minutes. C is an integer from 0 to 1,000.

Output

Print the hour and minute of the finishing time, separated by a space. The hour must be from 0 to 23, and the minute must be from 0 to 59.

On the digital clock, one minute after 23:59 is 0:00.