Rocky rolled over in bed and glanced at his LED alarm clock. He saw the time and drifted back to sleep. Later he woke again and glanced at the clock once more. Even though he could not tell which of the LED segments were still working, he was able to determine the exact time with certainty. Can you?
Rocky's LED clock shows the time with four 7-segment displays.
Each 7-segment display has seven bars and forms different digits by lighting different bars:
_ _ _ _ _ _ _ _
| | | _| _| |_| |_ |_ | |_| |_|
|_| | |_ _| | _| |_| | |_| _|
We can describe one display with seven bits, one bit per segment. Suppose the segments are numbered like this:

Then the display
|_
|
is written with the bits
0000111
so the ten digits can be written as:
| Number | Bit 1 | Bit 2 | Bit 3 | Bit 4 | Bit 5 | Bit 6 | Bit 7 |
|---|---|---|---|---|---|---|---|
| 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 |
| 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 |
| 2 | 1 | 1 | 0 | 1 | 1 | 0 | 1 |
| 3 | 1 | 1 | 1 | 1 | 0 | 0 | 1 |
| 4 | 0 | 1 | 1 | 0 | 0 | 1 | 1 |
| 5 | 1 | 0 | 1 | 1 | 0 | 1 | 1 |
| 6 | 1 | 0 | 1 | 1 | 1 | 1 | 1 |
| 7 | 1 | 1 | 1 | 0 | 0 | 0 | 0 |
| 8 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| 9 | 1 | 1 | 1 | 1 | 0 | 1 | 1 |
If a segment is "burnt out", it never lights even when it should. For example, if the digit 3 should be shown but the segment for bit 7 is burnt out, the display looks like this instead:
_
|
_|
The first line contains a single integer $n$, the number of data sets.
Each data set is one line of eight 7-bit strings describing the observed displays. The first four strings are the four displays of the first observed time, and the next four strings are the four displays of the second observed time. All strings are separated by single spaces. Which segments are burnt out is not given in the input.
For each data set, print exactly one line: the second observed time, in the format H:MM.
The burnt-out segments are the same for the first and the second observation. Every data set has exactly one possible answer.
Times use the standard (12-hour) format with no leading zero on the hour (nine o'clock is written 9:00, not 09:00), while the minutes always have two digits.