N = int(eval(input()))

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

count = 0

A.sort(key=lambda x: abs(x))

for x in A:

    if x < 0:

        count += 1

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

ans = 0

if count % 2 == 0:

    ans = sum(A)

else:

    ans = sum(A[1:]) - A[0]



print(ans)

N = int(eval(input()))

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



if abs(A[0]) < abs(A[-1]):

    A = A[::-1]

B = list(map(abs, A))

B.sort()

C = [x for x in A if x < 0]

n = len(C)

if n % 2 == 0:

    print((sum(B)))

else:

    print((sum(B[1:]) - B[0]))

N = int(eval(input()))
A = list(map(int, input().split()))
count = 0
A.sort(key=lambda x: abs(x))
for x in A:
    if x < 0:
        count += 1
A = [abs(x) for x in A]
ans = 0
if count % 2 == 0:
    ans = sum(A)
else:
    ans = sum(A[1:]) - A[0]
print(ans)

N = int(eval(input()))
A = list(map(int, input().split()))
if abs(A[0]) < abs(A[-1]):
    A = A[::-1]
B = list(map(abs, A))
B.sort()
C = [x for x in A if x < 0]
n = len(C)
if n % 2 == 0:
    print((sum(B)))
else:
    print((sum(B[1:]) - B[0]))

-count = 0 -A.sort(key=lambda x: abs(x)) -for x in A: -    if x < 0: -        count += 1 -A = [abs(x) for x in A] -ans = 0 -if count % 2 == 0: -    ans = sum(A) +if abs(A[0]) < abs(A[-1]): +    A = A[::-1] +B = list(map(abs, A)) +B.sort() +C = [x for x in A if x < 0] +n = len(C) +if n % 2 == 0: +    print((sum(B))) -    ans = sum(A[1:]) - A[0] -print(ans) +    print((sum(B[1:]) - B[0]))