eolymp
bolt
Try our new interface for solving problems
Problems

Avoiding a disaster

Avoiding a disaster

Percy likes to be punctual. So much so that he always keeps three watches with him, so that he can be sure exactly what the time is. However, Percy's having a bad day. He found out that one of his watches was giving the wrong time. What's worse, when he went to correct the watch, he corrected the wrong one! That is, one watch was running \textbf{x} minutes behind (where \textbf{x} ≤ \textbf{480}) and he wound one of the other watches \textbf{x} minutes forward. He now has three watches reading three different times, and hence is in serious danger of being tardy. Can you help Percy by writing a program that takes in the three times displayed on the watches and returns the correct time? \InputFile The input begins with an integer \textbf{T} indicating the number of cases that follow (\textbf{0} < \textbf{T} < \textbf{100}). Each of the following \textbf{T}lines contains one test case, made up of three readings, separated by single space characters: \textbf{H1:M1 H2:M2 H3:M3} In each reading \textbf{H1}, \textbf{H2}, \textbf{H3} represent the hours displayed (\textbf{0} < \textbf{H1}, \textbf{H2}, \textbf{H3} < \textbf{13}), and \textbf{M1}, \textbf{M2}, \textbf{M3} represent the minutes displayed (\textbf{0} ≤ \textbf{M1}, \textbf{M2}, \textbf{M3} < \textbf{60}). If the number of minutes is less than \textbf{10}, a leading \textbf{0} is added. \OutputFile For each test case, one line should be produced, formatted exactly as follows: "\textbf{The correct time is Hi:Mi}". If the number of minutes is less than \textbf{10}, a leading \textbf{0} should be added. If the number of hours is less than \textbf{10}, a leading \textbf{0}should NOT be added. If it is impossible to tell the time from the three readings, print the string: "\textbf{Look at the sun}".
Time limit 1 second
Memory limit 64 MiB
Input example #1
3
5:00 12:00 10:00
11:59 12:30 1:01
12:00 4:00 8:00
Output example #1
The correct time is 5:00
The correct time is 12:30
Look at the sun
Source The 2011 South Pacific Programming Contest