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
2010-11-24 14:34:52 hbm
No, I still don't see blank lines. Perhaps a p-tag instead of two br's?
Thanks!
2010-11-22 22:44:05 Piotr KÄ…kol
Is it better now?
2010-11-22 19:47:08 hbm
Ah, I see extra '<br />' tags in the source of this page, but they do not render in my browser (IE8)...
2010-11-21 10:44:13 Piotr KÄ…kol
Why it isn't? There are blank lines after each test (even the last one) in examples and tests.
2010-11-19 17:12:38 hbm
Piotr, The example isn't representative. Please add blank lines between the cases to match the description.
2010-02-28 20:56:33 Piotr KÄ…kol
I modified input description a bit.
Tests look like examples.
2010-02-27 14:36:42 HWK
The description of input isn't in line with the example. What's the right input-format?
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.