Ropes

No attempts yetTime limit1sMemory limit128 MB

Problem

When climbing a section, or "pitch", the lead climber ascends first, taking a rope with them that they anchor to the rock for protection. Once at the top of a pitch, the lead climber has the second climber attach to the rope so they can ascend with its safety. Once the second climber reaches the top of the pitch, the third attaches, and so on until all the climbers have ascended.

For example, for a 10 meter pitch and a 50 meter rope, at most 6 climbers can ascend, with the last climber attaching to the end of the rope. To ascend safely there must be at least 2 climbers, and the rope must be at least as long as the pitch.

This process is repeated on each pitch until the top is reached. To descend, the rope is hung at its midpoint from an anchor, forming two strands (each half must reach the ground). The climbers then rappel down this rope. The rope is retrieved by pulling one side so it slips through the anchor and falls to the ground.

To descend safely, the rope must be at least twice as long as the sum of the pitch lengths.

For example, a 60 meter rope is required to rappel a 30 meter climb, no matter how many climbers are involved.

Climbing ropes come in 50, 60 and 70 meter lengths. It is best to take the shortest rope needed for a given climb, because this saves weight. Determine the maximum number of climbers that can use each type of rope on a given climb.

Input

The input consists of several test cases. Each case describes a climb on one line, as a sequence of pitch lengths:

N P1 P2 ... PN

Here $N$ is the number of pitches, a positive integer with $1 \le N \le 100$, and $P_k$ is the length in meters of each pitch, a positive integer with $1 \le P_k \le 100$. The last line, indicating the end of input, is a single $0$.

Output

For each climb, print three numbers separated by spaces, giving the maximum number of climbers that could use the 50, 60 and 70 meter ropes respectively. Print $0$ if a given rope length is not suitable for that climb.