Олимпиадный тренинг

Задача 32973. SNTP


Задача

Темы: Разбор случаев
In order for computers to maintain up-to-date time, they can access SNTP (Simple Network Time Protocol) time servers. Unfortunately, the computer cannot simply get the time from the server, because information is not transmitted over the network instantly: until the message with the current time reaches the computer, it will lose its relevance. The protocol of interaction between the client (computer requesting the exact time) and the server (computer issuing the exact time) is as follows:
 
1) The client sends a request to the server and remembers the departure time A (client time).
2) The server receives the request at time B (exact server time) and sends a message to the client containing the time B.
3) The client receives a response to its request at time C (client time) and remembers it. Now the client, under the assumption that the network delays in the transmission of messages from the client to the server and from the server to the client are the same, can determine and set the exact time for itself using the known values ​​​​A, B, C.

You have to implement an algorithm that determines the exact time to install on the client with known A, B, and C to the nearest second. If necessary, round the result to an integer number of seconds according to the rules of arithmetic (down if the fractional part of the number is less than ½, otherwise large side). 

It is possible that a new day passed by client time while the client was waiting for a response, but it is known that less than 24 hours elapsed between the client sending a request and receiving a response from the server. 

The program receives as input three timestamps A, B, C, one in each line. All timestamps are in the format "hh:mm:ss", where "hh" – this is the clock, «mm» – minutes, "ss" – seconds. Hours, minutes, and seconds are written as exactly two digits each (possibly with extra leading zeros). 
 
The program should output one timestamp in the format described in the input, – calculated exact time to install on the client. The output should not contain spaces, empty lines at the beginning of the output.

Enter Output Note
15:01:00
18:09:45
15:01:40
18:10:05 The client sent the request at 15:01:00 local time, the server received the request at 18:09:45 local time. The client received a response at 15:01:40, at which point the exact time will be 18:10:05.