Ruler

Xiaoming wants to make a special ruler, which can directly measure several given lengths. Xiaoming hopes to find a way, making the scale on ruler as few as possible, while for a given length, there exists two scales on ruler and the distance between the two scales is equal to the given length. For scales as few as possible, we also hope the length of ruler as short as possible to save the material cost. Input Input contains several cases. Each case has two lines. The first line is an integer n (1 ≤ n ≤ 50) to specify how many given lengths need to measure. The second line contains n integers d1, d2, . . . dn, indicating the length values respectively (1 ≤ di ≤ 106, i ∈ [1, n]). The last case is followed by a line containing a zero. Output For each case, output three lines. The first line contains the case number. The second line is an integer M to specify the minimized number of scales needed. The third line is M integers to specify the distance between the leftmost scales and the other M scales respectively. Note: output scales in ascending order, the first number is always ‘0’. You can assume that M won’t exceed 7. Sample Input 6 5 15 20 25 35 40 0 Sample Output Case 1: 4 0 5 25 40