A reactor logs n per-cycle multiplier readings, one per line position. Each reading is an integer that may be negative (a phase inversion), zero (a shutdown), or positive. For a contiguous run of readings, its combined effect is the product of the readings in the run.
Find the maximum combined effect achievable over all non-empty contiguous runs of readings.
Input format
Line 1: the integer n.
Line 2: n space-separated integers r[0] r[1] ... r[n-1].
Output format
A single integer: the maximum product over all non-empty contiguous runs. The value may be large; print it exactly (no modulo).
Constraints
- 1 <= n <= 12
- -9 <= r[i] <= 9