#OLD385. Maximum Consecutive Sequence

Maximum Consecutive Sequence

Description

Kiudou always asks questions in the online math forum , and sometimes answers other netizen's questions. He accumulated a good popularity in the forum, so he was lucky to be invited to the 8th MathCon conference.During the break, he strolled through the small shops of souvenirs. One of the items caught his attention. This is a small ribbon with a sequence of numbers, and the ribbon seems to consist of n numbers. He thinks that if the sequence of numbers is a0,a1,...,an1a_0,a_1,...,a_{n-1} and at the same time aia_i is a 32-bit integer, and what the value of the maximum consecutive sequence is.

Format

Input

Input contains multiple cases.

For each case, the first line inputs an integer nn, and the second line inputs nn integers a0,a1,...,an1a_0,a_1,...,a_{n-1}. Numbers are separated by spaces. The constraint is 107ai107,1n106-10^7\leq a_i \leq 10^7,1 \leq n \leq 10^6,

Output

Print the sum of the maximum consecutive sequence, and the starting index ii and ending index jj of the sequence. If the maximum consecutive sequence is not unique, printing the smallest two index ii and jj.

If nn numbers are all negative, the sum is 0, the starting index ii is 0, and the ending index jj is the last index of the sequence.

Samples

4
1 -8 2 3

5 2 3

Hint