In this problem, you are given a sequence *S*_{1}, *S*_{2}, ..., *S*_{n} of squares of different sizes. The sides of the squares are integer numbers. We locate the squares on the positive *x*-*y* quarter of the plane, such that their sides make 45 degrees with *x* and *y* axes, and one of their vertices are on *y*=0 line. Let *b*_{i} be the *x* coordinates of the bottom vertex of *S*_{i}. First, put *S*_{1} such that its left vertex lies on *x*=0. Then, put *S*_{1}, (*i* > 1) at minimum *b*_{i} such that The goal is to find which squares are visible, either entirely or partially, when viewed from above. In the example above, the squares *S*_{1}, *S*_{2}, and *S*_{4} have this property. More formally, *S*_{i} is visible from above if it contains a point *p*, such that no square other than *S*_{i} intersect the vertical half-line drawn from *p* upwards.

*b*>_{i}*b*_{i}_{-1}and- the interior of
*S*does not have intersection with the interior of_{i}*S*_{1}...*S*_{i-1}.

The input consists of multiple test cases. The first line of each test case is *n* (1 ≤ *n* ≤ 50), the number of squares. The second line contains *n* integers between 1 to 30, where the *i*th number is the length of the sides of *S*_{i}. The input is terminated by a line containing a zero number.

提交代码