n = int(eval(input()))

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

ans = 0

minus = 0

q = abs(a[0])

for i in a:

    ans += abs(i)

    q = min(q,abs(i))

    if i < 0:

        minus += 1



if minus%2 == 0:

    print(ans)

else:

    print((ans - 2*q))
n = int(eval(input()))

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

minus = 0

mi = 10**10

ans = 0

for i in range(n):

    if a[i] < 0:minus+=1

    mi = min(mi,abs(a[i]))

    ans += abs(a[i])

if minus%2 == 0:

    print(ans)

else:

    print((ans-2*mi))
n = int(eval(input()))
a = list(map(int, input().split()))
ans = 0
minus = 0
q = abs(a[0])
for i in a:
    ans += abs(i)
    q = min(q, abs(i))
    if i < 0:
        minus += 1
if minus % 2 == 0:
    print(ans)
else:
    print((ans - 2 * q))

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

+minus = 0 +mi = 10**10 -minus = 0 -q = abs(a[0]) -for i in a: -    ans += abs(i) -    q = min(q, abs(i)) -    if i < 0: +for i in range(n): +    if a[i] < 0: +    mi = min(mi, abs(a[i])) +    ans += abs(a[i]) -    print((ans - 2 * q)) +    print((ans - 2 * mi))