n = int(eval(input()))

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



num_minus = 0

Min = float('inf')

Sum = 0

for i in range(n):

    if a_ls[i] < 0:

        num_minus += 1

    Min = min(abs(a_ls[i]),Min)

    Sum += abs(a_ls[i])

if num_minus % 2 == 0:

    ans = Sum 

else:

    ans = Sum - 2 * Min

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

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

abs_ls = [0] * N

minus = 0

for i in range(N):

    if a_ls[i] < 0:

        minus += 1

    abs_ls[i] = abs(a_ls[i])



if minus % 2 == 1:

    ans = sum(abs_ls) - 2 * min(abs_ls)

else:

    ans = sum(abs_ls)

print(ans)
n = int(eval(input()))
a_ls = list(map(int, input().split()))
num_minus = 0
Min = float("inf")
Sum = 0
for i in range(n):
    if a_ls[i] < 0:
        num_minus += 1
    Min = min(abs(a_ls[i]), Min)
    Sum += abs(a_ls[i])
if num_minus % 2 == 0:
    ans = Sum
else:
    ans = Sum - 2 * Min
print(ans)

N = int(eval(input()))
a_ls = list(map(int, input().split()))
abs_ls = [0] * N
minus = 0
for i in range(N):
    if a_ls[i] < 0:
        minus += 1
    abs_ls[i] = abs(a_ls[i])
if minus % 2 == 1:
    ans = sum(abs_ls) - 2 * min(abs_ls)
else:
    ans = sum(abs_ls)
print(ans)

-n = int(eval(input())) +N = int(eval(input())) -num_minus = 0 -Min = float("inf") -Sum = 0 -for i in range(n): +abs_ls = [0] * N +minus = 0 +for i in range(N): -        num_minus += 1 -    Min = min(abs(a_ls[i]), Min) -    Sum += abs(a_ls[i]) -if num_minus % 2 == 0: -    ans = Sum +        minus += 1 +    abs_ls[i] = abs(a_ls[i]) +if minus % 2 == 1: +    ans = sum(abs_ls) - 2 * min(abs_ls) -    ans = Sum - 2 * Min +    ans = sum(abs_ls)