Find the maximum operation The challenge is to find the maximum number you can get from a list of integer using basic arithmetic operators (addition, substraction, multiplication, unary negation)

Input

A list of integers

Output

The maximum result using every integer in the intput.

The input order doesn't matter, result should be the same.

You do not need to output the full operation, just the result.

Examples

Input : 3 0 1
Output : 4 (3 + 1 + 0)

Input : 3 1 1 2 2
Output : 27 ((2+1)*(2+1)*3))

Input : -1 5 0 6
Output : 36 (6 * (5 - (-1)) +0)

Input : -10 -10 -10
Output : 1000 -((-10) * (-10) * (-10))

Input : 1 1 1 1 1
Output : 6 ((1+1+1)*(1+1))


Rules


Shortest code wins
Standard "loopholes" apply
You may only use + * - operators (addition, multiplication, substraction, unary negation)
The code should work as long as the result can be stored on a 32 bit Integer. 
Any overflow behaviour is up to you.


I hope this is clear enough, this is my first Code Golf challenge suggestion.
C - 224 bytes - Running time O(n)
o=0,w=0,n[55],t,*m=n,*p=n;main(r){for(;scanf(&quot;%d&quot;,++p);t&lt;3?--p,w+=t/2,o+=t&amp;1:t&lt;*m|m==n?m=p:9)t=*p=abs(*p);t=o&lt;w?o:w;o-=t;w-=t;t+=o/3;for(o%3?o%3-2?t?t--,w+=2:++*m:w++:9;t--;)r*=3;for(r&lt;&lt;=w;--p&gt;n;)r*=*p;printf(&quot;%d&quot;,r&gt;1?r:o);}

It was amusing to see only exponential-time solutions for a linear-time problem, but I suppose it was the logical way to proceed since there were no bonus points for actually having an algorithm, which is an anagram of logarithm.
After converting negative numbers to positive and discarding zeroes, clearly we are mostly interested in multiplication. We want to maximize the logarithm of the final number.
log(a + b) &lt; log(a) + log(b) except when a = 1 or b = 1, so ones are the only case in which we are interested in adding anything together. In general it is better to add a 1 to  a smaller number, because that causes a bigger increase in logarithm, i.e. a larger percentage increase, than adding 1 to a big number.
There are four possible scenarios, ordered most to least preferable, for utilizing ones:

Adding one to a 2 gives +log .405  [log(3) - log(2)]
Combining ones into threes gives +log .366 per one  [log(3) / 3]
Making a 2 out of ones gives +log .347 per one  [log(2) / 2]
Adding one to a number 3 or higher gives +log .288 or less  [log(4) - log(3)]

The program keeps track of the number of ones, the number of twos, and the minimum number greater than 2, and goes down the list of the most to least preferable ways of using the ones. Finally, it multiplies all the remaining numbers.