N = int(eval(input()))

A = [int(x) for x in input().split()]



abs_list = sorted([abs(x) for x in A])[::-1]



for i in range(N-1):

    if A[i] < 0:

        A[i] *= -1

        A[i+1] *= -1



if abs(min(A)) != min(abs_list):

    A[A.index(min(A))] *= -1

    A[A.index(min(abs_list))] *= -1

    

print((sum(A)))
# D



N = int(eval(input()))

A = [int(x) for x in input().split()]



minus_num = len([x for x in A if x < 0])

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

if minus_num % 2:

    print((sum(abs_list) - min(abs_list)*2))

else:

    print((sum(abs_list)))
N = int(eval(input()))
A = [int(x) for x in input().split()]
abs_list = sorted([abs(x) for x in A])[::-1]
for i in range(N - 1):
    if A[i] < 0:
        A[i] *= -1
        A[i + 1] *= -1
if abs(min(A)) != min(abs_list):
    A[A.index(min(A))] *= -1
    A[A.index(min(abs_list))] *= -1
print((sum(A)))

# D
N = int(eval(input()))
A = [int(x) for x in input().split()]
minus_num = len([x for x in A if x < 0])
abs_list = [abs(x) for x in A]
if minus_num % 2:
    print((sum(abs_list) - min(abs_list) * 2))
else:
    print((sum(abs_list)))

+# D -abs_list = sorted([abs(x) for x in A])[::-1] -for i in range(N - 1): -    if A[i] < 0: -        A[i] *= -1 -        A[i + 1] *= -1 -if abs(min(A)) != min(abs_list): -    A[A.index(min(A))] *= -1 -    A[A.index(min(abs_list))] *= -1 -print((sum(A))) +minus_num = len([x for x in A if x < 0]) +abs_list = [abs(x) for x in A] +if minus_num % 2: +    print((sum(abs_list) - min(abs_list) * 2)) +else: +    print((sum(abs_list)))