N = int(eval(input()))

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

sum = 0

min = 1000000000

minus = 0

for n in range(N):

    n_abs = abs(A[n])

    sum += n_abs

    if min > n_abs:

        min = n_abs

    if A[n] < 0:

        minus += 1

if minus%2 != 0:

    sum -= 2*min

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

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

ABS_LIST = list(map(abs,A))

ABS_SUM = sum(ABS_LIST)

if len([x for x in A if x < 0])%2 != 0:

    print((ABS_SUM-min(ABS_LIST)*2))

else:

    print(ABS_SUM)
N = int(eval(input()))
A = list(map(int, input().split(" ")))
sum = 0
min = 1000000000
minus = 0
for n in range(N):
    n_abs = abs(A[n])
    sum += n_abs
    if min > n_abs:
        min = n_abs
    if A[n] < 0:
        minus += 1
if minus % 2 != 0:
    sum -= 2 * min
print(sum)

N = int(eval(input()))
A = list(map(int, input().split(" ")))
ABS_LIST = list(map(abs, A))
ABS_SUM = sum(ABS_LIST)
if len([x for x in A if x < 0]) % 2 != 0:
    print((ABS_SUM - min(ABS_LIST) * 2))
else:
    print(ABS_SUM)

-sum = 0 -min = 1000000000 -minus = 0 -for n in range(N): -    n_abs = abs(A[n]) -    sum += n_abs -    if min > n_abs: -        min = n_abs -    if A[n] < 0: -        minus += 1 -if minus % 2 != 0: -    sum -= 2 * min -print(sum) +ABS_LIST = list(map(abs, A)) +ABS_SUM = sum(ABS_LIST) +if len([x for x in A if x < 0]) % 2 != 0: +    print((ABS_SUM - min(ABS_LIST) * 2)) +else: +    print(ABS_SUM)