Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

No tag edit access

The problem statement has recently been changed. View the changes.

×
E. Swedish Heroes

time limit per test

2 secondsmemory limit per test

256 megabytesinput

standard inputoutput

standard outputWhile playing yet another strategy game, Mans has recruited $$$n$$$ Swedish heroes, whose powers which can be represented as an array $$$a$$$.

Unfortunately, not all of those mighty heroes were created as capable as he wanted, so that he decided to do something about it. In order to accomplish his goal, he can pick two consecutive heroes, with powers $$$a_i$$$ and $$$a_{i+1}$$$, remove them and insert a hero with power $$$-(a_i+a_{i+1})$$$ back in the same position.

For example if the array contains the elements $$$[5, 6, 7, 8]$$$, he can pick $$$6$$$ and $$$7$$$ and get $$$[5, -(6+7), 8] = [5, -13, 8]$$$.

After he will perform this operation $$$n-1$$$ times, Mans will end up having only one hero. He wants his power to be as big as possible. What's the largest possible power he can achieve?

Input

The first line contains a single integer $$$n$$$ ($$$1 \le n \le 200000$$$).

The second line contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$-10^9 \le a_i \le 10^9$$$) — powers of the heroes.

Output

Print the largest possible power he can achieve after $$$n-1$$$ operations.

Examples

Input

4 5 6 7 8

Output

26

Input

5 4 -5 9 -2 1

Output

15

Note

Suitable list of operations for the first sample:

$$$[5, 6, 7, 8] \rightarrow [-11, 7, 8] \rightarrow [-11, -15] \rightarrow [26]$$$

Codeforces (c) Copyright 2010-2021 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Aug/04/2021 17:44:53 (h1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|