eolymp
bolt
Try our new interface for solving problems
Problems

Marathon runner

Marathon runner

Barash became interested in running. And in order not to be bored, he listens to music while running.

Today Barash forgot to turn on the stopwatch at the beginning of the run, so now he does not know how long he has been running. However, he naturally did not forget to turn on the music. Now he wants to calculate the duration of his run using information about the songs he has listened to.

In total, he listened to n songs in their entirety during the run. For each song, he wrote down its duration in the format mm:ss. There are exactly two digits before the colon, indicating the number of minutes, and after exactly two digits, indicating the number of seconds. Each song is strictly less than an hour long, with minutes and seconds ranging from 0 to 59 inclusive.

Help Barash determine the duration of the run and output it in the format hh:mm:ss. First exactly two digits for the number of hours, then two digits for the number of minutes, and finally for the number of seconds. It is guaranteed that Barash ran strictly less than a day. The number of hours must be between 0 and 23, and the number of minutes and seconds must be between 0 and 59.

Input

The first line contains one integer n (1n1000) - the number of songs that Barash managed to listen to during his run.

Next, n lines are given, each of which has the form mm:ss - the duration of the next song. It is guaranteed that the durations of all songs are positive.

Output

Print the duration of Barash's run in the format hh:mm:ss. It is guaranteed that Barash ran strictly less than a day.

Time limit 1 second
Memory limit 128 MiB
Input example #1
2
10:01
00:59
Output example #1
00:11:00
Input example #2
3
12:34
23:45
34:56
Output example #2
01:11:15
Source 2020 Cycle of Internet Olympiads for schoolchildren, First team contest, October 18, Problem J