CLOCK | 프로그래밍의 벗 PivotOJ
PivotOJ

CLOCK

시간 제한: 2000ms메모리 제한: 128MB출처: CHC 2001 Regional Competition - JuniorsBOJ 2082

문제

One day, Dave made a digital clock. Each of four numbers needed to display a time (in hhmm format) on it is represented with 15 small red LED diodes arranged in a 5x3 matrix as shown below ('#' represents lit diode, and '.' unlit diode).

###  ..#  ###  ###  #.#  ###  ###  ###  ###  ###
#.#  ..#  ..#  ..#  #.#  #..  #..  ..#  #.#  #.#
#.#  ..#  ###  ###  ###  ###  ###  ..#  ###  ###
#.#  ..#  #..  ..#  ..#  ..#  #.#  ..#  #.#  ..#
###  ..#  ###  ###  ..#  ###  ###  ..#  ###  ###

Dave set the correct time on his new clock and, being exhausted with effort needed to make the clock went to sleep.

When he woke up next morning, he looked at his new clock and found out that some of diodes went off.

Write a program that will determine the earliest possible time that corresponds to Dave’s faulty clock display.

입력

Input file contains four 5x3 groups of characters '#' and '.' separated by one column of spaces. Those four groups represent arrangement of lit and unlit diodes of a faulty display.

출력

The first and only line of output file should contain desired time.

예제

예제 1

입력
#.# ... ... #..
#.# ... ... #..
#.# ### ### ###
#.# #.. ..# ..#
### ### ### ..#
출력
02:34

예제 2

입력
### ### ..# ...
... #.# #.# #.#
### #.# .#. .#.
#.. #.# ..# ..#
### #.# ..# ###
출력
20:48

예제 3

입력
#.. #.# #.# .#.
..# #.. ... #..
#.# .## ### .##
..# #.# ... ...
#.# ### ##. ###
출력
06:25
코드를 제출하려면 로그인하세요.