n = int(eval(input()))

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

m = 100000000000

count = 0

ans = 0

for i in range(n):

    if a[i] < 0:

        count += 1

    x = abs(a[i]) 

    ans += x

    m = min(m,x)

if count % 2 != 0:

    ans -= 2*m

print(ans)

n = int(eval(input()))

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

m = 10000000000

count = 0

for i in range(n):

    if a[i] < 0:

        count += 1

        a[i] = -a[i]

if count % 2 == 1:

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

else:

    print((sum(a)))
n = int(eval(input()))
a = list(map(int, input().split()))
m = 100000000000
count = 0
ans = 0
for i in range(n):
    if a[i] < 0:
        count += 1
    x = abs(a[i])
    ans += x
    m = min(m, x)
if count % 2 != 0:
    ans -= 2 * m
print(ans)

n = int(eval(input()))
a = list(map(int, input().split()))
m = 10000000000
count = 0
for i in range(n):
    if a[i] < 0:
        count += 1
        a[i] = -a[i]
if count % 2 == 1:
    print((sum(a) - 2 * min(a)))
else:
    print((sum(a)))

-m = 100000000000 +m = 10000000000 -ans = 0 -    x = abs(a[i]) -    ans += x -    m = min(m, x) -if count % 2 != 0: -    ans -= 2 * m -print(ans) +        a[i] = -a[i] +if count % 2 == 1: +    print((sum(a) - 2 * min(a))) +else: +    print((sum(a)))