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
b
i > b
i-1 and
the interior of S
i does not have intersection with the interior of S
1...S
i-1.
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.