Team Work

No attempts yetTime limit5sMemory limit128 MB

Problem

A programming-contest coach is frustrated that his teams lack team work. To show his students how important team work is, he uses a well-known analogy: a single stick is easy to snap in two, but if you bundle three sticks together (the three members of a team) it takes far more force to snap them.

So the coach went to the forest to collect sticks. Wanting to rehearse the demonstration and iron out any problems, he confirmed that three bundled sticks are practically impossible to snap while a single stick snaps very easily. Unfortunately, every stick he had carefully collected broke into smaller pieces.

Then he had a clever idea: glue the pieces back together into longer sticks! Any piece can be glued securely to any other piece, even if the two came from different original sticks. So he can rebuild a stick by joining two or more pieces. A rebuilt stick, however, snaps very easily at each joint (connection point). Moreover, if two sticks have a connection point at the same position, the two sticks snap just as easily at that position even when bundled.

Therefore he must rebuild three sticks so that no two of their connection points lie at the same position. The rebuilt sticks should also be as long as possible, and all three must have the same length (he does not want to suggest that one team member is better than another). Some pieces may be left unused, and each piece may be used at most once.

Find the greatest common length for which three sticks can be rebuilt under these rules.

Input

The input consists of several test cases. Each case is given on one line. The first number is the number of pieces $N$. The next $N$ numbers are positive integers giving the length of each piece. There are at most 13 pieces, and each piece has length at most 25. The end of input is a case with $N = 0$.

Output

For each case, print the case number and a colon, followed by the longest possible length of the three rebuilt sticks, on a single line (format: Case X: L). If it is impossible to rebuild three sticks satisfying the rules, then the longest possible length is 0.