Problem hidden
This problem was hidden by Editorial Board member probably because it has incorrect language version or invalid test data, or description of the problem is not clear.

BINCLOCK - Binary clock

John found on the internet a specific type of clock which is called binary clock. He got interested in those clocks but he is not sure if he can change normal hour to binary format, so he asked you to write a program which would check whether he made it correctly or not.

Explanation of binary clock: http://en.wikipedia.org/wiki/Binary_clock

Input

The first line of the standard input contains one integer t (t<101) which is the number of test cases.

In each of the next t tests there are 24 digits (four lines with 6 digits in each of them) which represent the binary clock. There is one blank line after each test.

Output

One line with hour in following format: hour:min:sec or ERROR if time is incorrect.

Example

Input:

3
000000
000000
000000
010101

000000
010101
001011
100110

000001
000001
000001
000001

Output:
01:01:01
14:25:36
ERROR


Added by:Piotr Kąkol
Date:2009-12-21
Time limit:10s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: SCM qobi

hide comments
2014-12-05 02:02:15 Piotr KÄ…kol
For:
000000
010000
100000
000000

You print 24:00:00 instead of ERROR.
2014-12-04 20:50:00 Kurt Schwind

Not sure why I'm failing the tests with this submission:
13060024

I even wrote a script that tests every combination and compared the output to a script that passed and the output was identical.
2014-08-29 19:45:34 its_time_to_code
thanks :)
2014-08-26 02:55:18 Piotr KÄ…kol
@Rajat Sharma - If minutes are greater than 59 you should print "ERROR".
2014-08-21 17:31:20 its_time_to_code
why i'm getting W.A. ?
2014-01-16 19:39:00 Piotr KÄ…kol
You print e.g. 103 seconds/minutes/hours instead of ERROR.
2014-01-16 16:54:29 Linghui Liu
@piotr, what am I missing in 10881431?
2012-02-18 10:56:31 Jander
@Zorro - Well done! I'm going to have to go back and look at my solution again now :-)
2011-04-26 19:01:41 Piotr KÄ…kol
That's the error:
Traceback (most recent call last):
File "/sources/tested.py", line 26, in
File "/sources/tested.py", line 12, in BINCLOCK
File "", line 1
0b0001
^
SyntaxError: unexpected EOF while parsing
2011-04-26 11:42:04 512_I
Getting NZEC dont know y?
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.