Chef likes cooking. But more than that, he likes to give gifts. And now he wants to give his girlfriend an unforgettable gift. But unfortunately he forgot the password to the safe where the money he saved for the gift is kept.

But he knows how to hack the safe. To do this, you need to correctly answer questions asked by the embedded computer. The computer is very strange, and asks special questions, sometimes it can ask about 10000 question (really weird). Because of this, Chef wants you to write a program that will help him to crack the safe.

The questions are different, but there is only one type of question. Several numbers are given and between them one of three characters: *, +, - can be inserted. Note that in this case there is no priority for the operators, that is, if + is the before multiplication, you must first execute the operation of addition, and then multiplication (1 - 2 * 3 must be interpreted as (1 - 2) * 3 = -3 and not -5). The computer asks the minimum possible value of any valid expression.

------ Input ------ 

The first line of the input contains an integer T denoting the number of test cases. The first line of each test case contains a positive integer N. The second line contains N space separated integers A_{1}, A_{2}, ..., A_{N} denoting the expression without the operators.
 
------ Output ------ 

For each test case, output a single line containing the minimal value of given expression. 

------ Constraints ------ 

$1 ≤ T ≤ 10^{5}$
$1 ≤ N ≤ 10$
$-9 ≤ A_{i} ≤ 9 .
$ 

------  Scoring  ------ 

Subtask 1 (15 points):  1 ≤ T ≤ 10  

Subtask 2 (10 points):  1 ≤ N ≤ 3    

Subtask 3 (20 points):  1 ≤ A_{i} ≤ 5. 

Subtask 4 (35 points): 1 ≤ T  ≤ 10^{4} 
 
Subtask 5 (20 points):  Look at constraints.         

----- Sample Input 1 ------ 
2
3
1 2 3
1
9
----- Sample Output 1 ------ 
-4
9
----- explanation 1 ------ 
Example case 1:  1-2-3 = -4

Difficulty: HARD

Solutions:
for _ in range(int(input())):
	n = int(input())
	a = [int(x) for x in input().split()]
	best = a[0]
	worst = a[0]
	for i in range(1, n):
		newbest = best
		newworst = worst
		newbest = max(newbest, best + a[i])
		newbest = max(newbest, worst + a[i])
		newbest = max(newbest, best - a[i])
		newbest = max(newbest, worst - a[i])
		newbest = max(newbest, best * a[i])
		newbest = max(newbest, worst * a[i])
		newworst = min(newworst, worst + a[i])
		newworst = min(newworst, best + a[i])
		newworst = min(newworst, worst - a[i])
		newworst = min(newworst, best - a[i])
		newworst = min(newworst, worst * a[i])
		newworst = min(newworst, best * a[i])
		best = newbest
		worst = newworst
	print(worst)


import re
from functools import reduce
INPUT_PAT = re.compile('(-?\\d+)\\s*')

def smallest_expression(a, b):
	return (min(a[0] - b, a[0] + b, a[0] * b, a[1] * b), max(a[1] - b, a[1] + b, a[0] * b, a[1] * b))
num_examples = int(input())
for _ in range(num_examples):
	n = int(input())
	(a0, *a) = (int(i) for i in INPUT_PAT.findall(input()))
	print(reduce(smallest_expression, a, (a0, a0))[0])


def eval(A):
	best_eval = [0] * (len(A) + 1)
	worst_eval = [0] * (len(A) + 1)
	best_eval[0] = A[0]
	worst_eval[0] = A[0]
	for i in range(1, len(A)):
		if A[i] > 0:
			best_eval[i] = max(best_eval[i - 1] + A[i], best_eval[i - 1] - A[i], best_eval[i - 1] * A[i])
			worst_eval[i] = min(worst_eval[i - 1] + A[i], worst_eval[i - 1] - A[i], worst_eval[i - 1] * A[i])
		else:
			best_eval[i] = max(best_eval[i - 1] + A[i], best_eval[i - 1] - A[i], worst_eval[i - 1] * A[i])
			worst_eval[i] = min(worst_eval[i - 1] + A[i], worst_eval[i - 1] - A[i], best_eval[i - 1] * A[i])
	return worst_eval[len(A) - 1]
ot = []
test = int(input())
for i in range(test):
	l = []
	e = int(input())
	l = list(map(int, input().split()))
	ot.append(l)
for i in ot:
	print(eval(i))


def doshit(arr, val):
	if len(arr) == 1:
		v = arr[0]
		l = [v + val, v - val, v * val]
		return (max(l), min(l))
	else:
		(ma, mi) = doshit(arr[:-1], arr[-1])
		l = [ma + val, ma - val, ma * val, mi + val, mi - val, mi * val]
		return (max(l), min(l))
t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().strip().split(' ')))
	if len(arr) == 1:
		print(arr[0])
	else:
		(ma, mi) = doshit(arr[:-1], arr[-1])
		print(mi)