Magnificent Meatballs

Time limit1sMemory limit128 MB

Problem

Sam and Ella run a catering service. They like to put on a show when serving meatballs to guests seated at a round table. They march out of the kitchen with pots of meatballs and start serving adjacent guests: Ella goes counterclockwise and Sam goes clockwise, until they both place their last meatball at the same time, again at adjacent guests. This routine works only if they can split the table into two sections that hold the same number of meatballs. Write a program to help them.

At each event a table seats $2 \le N \le 30$ guests. Every guest orders between one and nine meatballs (inclusive). The seats are numbered from $1$ to $N$: the host sits at position $1$ and the host's spouse at position $N$. Sam serves the host first, then continues in increasing order of position. Ella serves the spouse first, then continues in decreasing order of position. Sam ends at some position $k$ and Ella ends at the adjacent position $k + 1$, so Sam serves positions $1$ through $k$ while Ella serves positions $k + 1$ through $N$. An equal partition exists when the meatballs served by Sam equal the meatballs served by Ella.

Input

The input consists of one or more test cases. Each test case gives the number of guests $N$, followed by the meatballs ordered by each guest from guest $1$ to guest $N$. The values may be separated by any whitespace. The input ends with a line containing a single zero, which is not processed.

Output

For each table, print a single line. If an equal partition exists, print

Sam stops at position S and Ella stops at position E.

where $S$ is Sam's ending position and $E = S + 1$ is Ella's ending position. Because every guest orders at least one meatball, the split position is unique when it exists. If no equal partition is possible, print

No equal partitioning.