N=int(eval(input()))

A=list(map(int,input().split()))



dp=[[0]*2 for i in range(N)]



dp[0][0]=0

dp[0][1]=-3*10**9



for i in range(N-1):

	dp[i+1][0]=max(dp[i][0]+A[i], dp[i][1]-A[i])

	dp[i+1][1]=max(dp[i][0]-A[i], dp[i][1]+A[i])

 

print((max(dp[-1][0]+A[-1], dp[-1][1]-A[-1])))
N=int(eval(input()))

A=list(map(int,input().split()))



if 0 in A:

	print((sum(abs(a) for a in A)))

else:

	cnt=sum([1 for a in A if a<0])

	

	if cnt%2==0:

		print((sum(abs(a) for a in A)))

	else:

		A=[abs(a) for a in A]

		print((sum(A) -2*min(A)))
N = int(eval(input()))
A = list(map(int, input().split()))
dp = [[0] * 2 for i in range(N)]
dp[0][0] = 0
dp[0][1] = -3 * 10**9
for i in range(N - 1):
    dp[i + 1][0] = max(dp[i][0] + A[i], dp[i][1] - A[i])
    dp[i + 1][1] = max(dp[i][0] - A[i], dp[i][1] + A[i])
print((max(dp[-1][0] + A[-1], dp[-1][1] - A[-1])))

N = int(eval(input()))
A = list(map(int, input().split()))
if 0 in A:
    print((sum(abs(a) for a in A)))
else:
    cnt = sum([1 for a in A if a < 0])
    if cnt % 2 == 0:
        print((sum(abs(a) for a in A)))
    else:
        A = [abs(a) for a in A]
        print((sum(A) - 2 * min(A)))

-dp = [[0] * 2 for i in range(N)] -dp[0][0] = 0 -dp[0][1] = -3 * 10**9 -for i in range(N - 1): -    dp[i + 1][0] = max(dp[i][0] + A[i], dp[i][1] - A[i]) -    dp[i + 1][1] = max(dp[i][0] - A[i], dp[i][1] + A[i]) -print((max(dp[-1][0] + A[-1], dp[-1][1] - A[-1]))) +if 0 in A: +    print((sum(abs(a) for a in A))) +else: +    cnt = sum([1 for a in A if a < 0]) +    if cnt % 2 == 0: +        print((sum(abs(a) for a in A))) +    else: +        A = [abs(a) for a in A] +        print((sum(A) - 2 * min(A)))