Given a lever of length L, with some weights placing on it, find an integer point p in the range [0, L − 1] to place the pivot and make the lever in balance. The torque ti contributed by a weight wi at point i is wi × (i − p), and the lever is said to be in balance if ∑ ti = 0.

The figure above shows an example of L = 4, and the pivot is selected at p = 2. Note that the selected position fails to balance the lever since ∑ ti = −1. In fact, no integer point in the range [0, L – 1] is able to balance the lever in this scenario.
Each test case begins with a line consists of an integer L (2 ≤ L ≤ 10000), denoting the length of the lever. The following line contains L space-separated integers wi (0 ≤ i < L, 0 ≤ wi ≤ 100, ∑ wi > 0), where wi denotes the weight at position i or nothing is placed there if wi = 0.
The input is terminated by L = 0.
For each test case, output an integer in a line representing the position to place the pivot so that the lever can be balanced. In case that no such integer point exists, or there are more than one possible solution, output −1 instead.