n = int(eval(input()))

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



count = 0

minus = 0

total = 0

for i in range(n):

    if a[i] == 0:

        count = i

if count == 0:

    while count < n:

        if a[count] < 0:

            minus += 1

        count += 1

else:

    minus = 0



if minus%2 == 0:

    for i in range(n):

        a[i] = abs(a[i])

    total = sum(a)

else:

    for i in range(n):

        a[i] = abs(a[i])

    total = sum(a) - min(a)*2



print(total)
n = int(eval(input()))

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



count = 0

for i in range(n):

    if a[i] < 0:

        count += 1



if count % 2 == 0:

    for i in range(n):

        a[i] = abs(a[i])

    total = sum(a)

else:

    for i in range(n):

        a[i] = abs(a[i])

    total = sum(a) - min(a)*2



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

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

-minus = 0 -total = 0 -    if a[i] == 0: -        count = i -if count == 0: -    while count < n: -        if a[count] < 0: -            minus += 1 +    if a[i] < 0: -else: -    minus = 0 -if minus % 2 == 0: +if count % 2 == 0: