n = int(eval(input()))

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

mina = abs(A[0])

minus = 0

sumA = 0

for a in A:

    if a < 0:

        minus += 1

        a = -a

    sumA += a

    mina = min(a, mina)

if minus % 2 == 1:

    sumA -= 2 * mina

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

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

mina = 10**9

minus = 0

sumA = 0

for a in A:

    if a < 0:

        minus += 1

        a = -a

    sumA += a

    mina = min(a, mina)

if minus % 2 == 1:

    sumA -= 2 * mina

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

n = int(eval(input()))
A = list(map(int, input().split()))
mina = 10**9
minus = 0
sumA = 0
for a in A:
    if a < 0:
        minus += 1
        a = -a
    sumA += a
    mina = min(a, mina)
if minus % 2 == 1:
    sumA -= 2 * mina
print(sumA)

-mina = abs(A[0]) +mina = 10**9