N = int(eval(input()))

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



minus = 1

for i,a in enumerate(A) :

    if a < 0 :

        minus *= -1

        A[i] = -a



ans = sum(A)



A.sort()



if minus == -1 :

    ans -= A[0] * 2



print(ans)

N = int(eval(input()))

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



negA = []

posA = []

for a in A:

    if a >= 0:

        posA.append(a)

    else:

        negA.append(a)



ans = sum(posA) - sum(negA)



if len(negA) % 2 == 1:

    ans -= min([abs(a) for a in A]) * 2



print(ans)

N = int(eval(input()))
A = list(map(int, input().split()))
minus = 1
for i, a in enumerate(A):
    if a < 0:
        minus *= -1
        A[i] = -a
ans = sum(A)
A.sort()
if minus == -1:
    ans -= A[0] * 2
print(ans)

N = int(eval(input()))
A = list(map(int, input().split()))
negA = []
posA = []
for a in A:
    if a >= 0:
        posA.append(a)
    else:
        negA.append(a)
ans = sum(posA) - sum(negA)
if len(negA) % 2 == 1:
    ans -= min([abs(a) for a in A]) * 2
print(ans)

-minus = 1 -for i, a in enumerate(A): -    if a < 0: -        minus *= -1 -        A[i] = -a -ans = sum(A) -A.sort() -if minus == -1: -    ans -= A[0] * 2 +negA = [] +posA = [] +for a in A: +    if a >= 0: +        posA.append(a) +    else: +        negA.append(a) +ans = sum(posA) - sum(negA) +if len(negA) % 2 == 1: +    ans -= min([abs(a) for a in A]) * 2