# Pref Suff Chmyaaax Diff

You are given an array $a_{1},a_{2},…,a_{n}$ consisting of $n$ integers. You need to perform the following steps in the given order:

Take some index $k$ $(1≤k≤n−1)$.

Divide the array $a$ into two parts: $a_{1},a_{2},…,a_{k}$ and $a_{k+1},a_{k+2},…,a_{n}$.

Remove one element from both parts.

Let $c$ be the sum of elements of the first resulting part and let $d$ be the sum of elements of the second one. You need to find the maximum possible value of $∣c−d∣$. In other words, your task is to find the maximum possible difference between sums of the resulting parts after performing these steps.

You can assume that the sum of elements of the empty part is $0$.

## Input

In the first line, there is one integer $n$ $(2≤n≤10_{5})$ — the number of elements in the array $a$.

In the second line, there are $n$ integers $a_{i}$ $(−10_{3}≤a_{i}≤10_{3})$ — the elements of the array.

## Output

In the first and only line, you need to output a single integer — the maximum possible difference between sums of the resulting parts after performing such steps.

## Examples

## Note

In the first sample, the only way to divide the array is to take $k=1$, i.e. make two subarrays $[1]$ and $[2]$. Since they both consist of one element, the only way to remove one element from each subarray is to remove both of them. This way, the subarrays become empty, their sums become $0$, thus the answer is $∣0−0∣=0$.

In the second sample, there are $10$ ways of performing operations:

$[2],[−5,4,−7]$ -> $[],[4,−7]$ -> the result is $∣0−(4+(−7))∣=∣0−(−3)∣=3$;

$[2],[−5,4,−7]$ -> $[],[−5,−7]$ -> the result is $∣0−(−5+(−7))∣=12$;

$[2],[−5,4,−7]$ -> $[],[−5,4]$ -> $∣0−(−5+4)∣=1$;

$[2,−5],[4,−7]$ -> $[−5],[−7]$ -> $∣(−5)−(−7)∣=2$;

$[2,−5],[4,−7]$ -> $[−5],[4]$ -> $∣(−5)−(4)∣=9$;

$[2,−5],[4,−7]$ -> $[2],[−7]$ -> $∣(2)−(−7)∣=9$;

$[2,−5],[4,−7]$ -> $[2],[4]$ -> $∣(2)−(4)∣=2$;

$[2],[−5,4,−7]$ -> $[],[4,−7]$ -> $∣0−(4+(−7))∣=3$;

$[2],[−5,4,−7]$ -> $[],[−5,−7]$ -> $∣0−(−5+(−7))∣=12$;

$[2],[−5,4,−7]$ -> $[],[−5,4]$ -> $∣0−(−5+4)∣=1$.

As we can notice, the maximum possible value here is $12$, which can be obtained by taking $k=2$ and leaving $−5$ from the first resulting subarray and $−7$ from the second one.

In the third sample, it does not matter how do we divide the array or what element to we remove from them — the sum of any of the resulting subarrays will always be $0$, as well as the difference between them.

## Scoring

($4$ points): $n≤3$;

($4$ points): all elements of the array are equal ($a_{i}=a_{j}$ for all $1≤i,j≤n$);

($5$ points): all elements of the array are positive ($a_{i}>0$ for all $1≤i≤n$);

($7$ points): the array is non-decreasing ($a_{i}≤a_{j}$ for all $1≤i<j≤n$);

($10$ points): $n≤300$;

($10$ points): $n≤2000$;

($10$ points): no additional constraints.