N = int(eval(input()))

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

cnt = 0

B=[None]*N

C=10**9+1

for i in range(len(A)):

  B[i]=abs(A[i])

  C=min(C,B[i])

  if A[i]<0:

    cnt+=1

ret = sum(B)-C+C*(-1)**cnt

print(ret)
N = int(eval(input()))

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

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

A=list(map(abs,A))

ret = sum(A)-min(A)*(1-(-1)**cnt)

print(ret)
N = int(eval(input()))
A = list(map(int, input().split()))
cnt = 0
B = [None] * N
C = 10**9 + 1
for i in range(len(A)):
    B[i] = abs(A[i])
    C = min(C, B[i])
    if A[i] < 0:
        cnt += 1
ret = sum(B) - C + C * (-1) ** cnt
print(ret)

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

-cnt = 0 -B = [None] * N -C = 10**9 + 1 -for i in range(len(A)): -    B[i] = abs(A[i]) -    C = min(C, B[i]) -    if A[i] < 0: -        cnt += 1 -ret = sum(B) - C + C * (-1) ** cnt +cnt = sum([1 for i in A if i < 0]) +A = list(map(abs, A)) +ret = sum(A) - min(A) * (1 - (-1) ** cnt)