Under construction

Still being built. Things may change

Marathoner

Time limit2sMemory limit1024 MB

Summary
Sum n song durations given as mm:ss and print the total run length in hh:mm:ss format.
Level

Easy2 of 10

Topics
Implementation, String
Solved
No attempts yet

Problem

Baraš got into running. To keep it from getting boring, he listens to music while he runs.

Today Baraš forgot to start the stopwatch at the beginning of his run, so he does not know how long he ran. He did remember to turn on the music, though. He now wants to work out the length of the run from the songs he listened to.

During the run he listened to nn songs in full. For each song he wrote down its duration in mm:ss format. Exactly two digits come before the colon for minutes, and exactly two digits come after it for seconds. Each song is strictly shorter than an hour, and the minutes and seconds are between 0 and 59 inclusive.

Help Baraš find the duration of the run and print it in hh:mm:ss format: two digits for hours, then two for minutes, then two for seconds. The run is guaranteed to be strictly less than a day. Hours are between 0 and 23, and minutes and seconds are between 0 and 59.

Input

The first line contains one integer nn, the number of songs Baraš managed to listen to during the run (1≤n≤1 0001 \le n \le 1\,000). Then nn lines follow, each in the form mm:ss, giving the duration of one song. All song durations are guaranteed to be positive.

Output

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

Examples2

  1. Example 1

    Input
    2
    10:01
    00:59
    
    Expected output
    00:11:00
    
  2. Example 2

    Input
    3
    12:34
    23:45
    34:56
    
    Expected output
    01:11:15