n = int(eval(input()))

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

cnt = 0

for a in A:

    if a < 0:

        cnt += 1

res = 0

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

A.sort()

for a in A:

        res += a

if cnt%2 == 1:

    res -= 2*A[0]

print(res)
n = int(eval(input()))

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

cnt = 0

for a in A:

    if a < 0:

        cnt += 1

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

res = sum(A)

if cnt%2 == 1:

    res -= 2*min(A)

print(res)
n = int(eval(input()))
A = list(map(int, input().split()))
cnt = 0
for a in A:
    if a < 0:
        cnt += 1
res = 0
A = [abs(a) for a in A]
A.sort()
for a in A:
    res += a
if cnt % 2 == 1:
    res -= 2 * A[0]
print(res)

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

-res = 0 -A.sort() -for a in A: -    res += a +res = sum(A) -    res -= 2 * A[0] +    res -= 2 * min(A)