For each test case, there is one line of input containing the following items:
A positive integer N (1 <= N <= 50), the number of minutes you have been watching the clock.
N items, each representing a pattern of digits that was observed on the clock. Each pattern is formatted as two decimal digits, followed by a ‘:’ character, followed by two more decimal digits.
The patterns are listed in the order in which they were seen on the clock.
It is theoretically possible for a faulty 7-segment display to show a shape which does not correspond to any of the digits from 0 to 9. However, for some mysterious reason, this never happened during the time you were watching the clock.