from numpy import sign

n=int(eval(input()))

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

a_abs=list(map(abs,a))

a_abs.sort()



plmi=1

for i in a:

    plmi*=sign(i)



if plmi==-1:

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

elif plmi==1 or plmi==0:

    ans=sum(a_abs)

print(ans)
import numpy as np

N = int(eval(input()))

A = np.array(input().split(), dtype=np.int64)



neg = np.count_nonzero(A[A < 0])

ans = np.abs(A).sum()

if neg % 2 == 1:

    v = np.abs(A).min()

    ans -= 2 * v



print(ans)

from numpy import sign

n = int(eval(input()))
a = list(map(int, input().split()))
a_abs = list(map(abs, a))
a_abs.sort()
plmi = 1
for i in a:
    plmi *= sign(i)
if plmi == -1:
    ans = sum(a_abs[1:]) - a_abs[0]
elif plmi == 1 or plmi == 0:
    ans = sum(a_abs)
print(ans)

import numpy as np

N = int(eval(input()))
A = np.array(input().split(), dtype=np.int64)
neg = np.count_nonzero(A[A < 0])
ans = np.abs(A).sum()
if neg % 2 == 1:
    v = np.abs(A).min()
    ans -= 2 * v
print(ans)

-from numpy import sign +import numpy as np -n = int(eval(input())) -a = list(map(int, input().split())) -a_abs = list(map(abs, a)) -a_abs.sort() -plmi = 1 -for i in a: -    plmi *= sign(i) -if plmi == -1: -    ans = sum(a_abs[1:]) - a_abs[0] -elif plmi == 1 or plmi == 0: -    ans = sum(a_abs) +N = int(eval(input())) +A = np.array(input().split(), dtype=np.int64) +neg = np.count_nonzero(A[A < 0]) +ans = np.abs(A).sum() +if neg % 2 == 1: +    v = np.abs(A).min() +    ans -= 2 * v