시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 512 MB 1 1 1 100.000%

문제

Little Q's alarm is ringing! It's time to get up now! However, after reading the time on the clock, Little Q lies down and starts sleeping again. Well, he has five alarms, and it's just the first one, he can continue sleeping for a while.

Little Q's clock uses a standard 7-segment LCD display for all digits, plus two small segments for the ":", and shows all times in 24-hour format. The ":" segments are on at all times.

Your job is to help Little Q read the time shown on his clock.

입력

The first line of the input contains an integer $T$: the number of test cases ($1 \leq T \leq 1440$).

Each test case is given on seven lines as a $7 \times 21$ ASCII image of the clock screen.

Each digit segment is represented by two characters, and each colon segment is represented by one character. Character "X" indicates a lit segment, character "." indicates a dark segment or empty space. See the sample input for details.

출력

For each test case, print a single line containing a string $t$ formatted as "HH:MM": the time shown on the clock ($\texttt{00:00} \leq t \leq \texttt{23:59}$).

예제 입력 1

1
.XX...XX.....XX...XX.
X..X....X......X.X..X
X..X....X.X....X.X..X
......XX.....XX...XX.
X..X.X....X....X.X..X
X..X.X.........X.X..X
.XX...XX.....XX...XX.

예제 출력 1

02:38