n = int(eval(input()))

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

minus_num = 0

for i in range(n):

    if a[i] < 0:

        minus_num += 1

if minus_num % 2 == 0:

    ans = 0

    for i in range(n):

        ans += abs(a[i])

else:

    min_abs = abs(a[0])

    ans = 0

    for i in range(n):

        ans += abs(a[i])

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

    ans = ans - min_abs * 2

print(ans)

n = int(eval(input()))

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

cnt = 0

for i in range(n):

    if a[i] < 0:

        cnt += 1

ans = 0

if cnt % 2 == 0:

    for i in range(n):

        ans += abs(a[i])

    print(ans)

else:

    tar = abs(a[0])

    for i in range(n):

        ans += abs(a[i])

        if tar > abs(a[i]):

            tar = abs(a[i])

    print((ans-2*tar))

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

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

-minus_num = 0 +cnt = 0 -        minus_num += 1 -if minus_num % 2 == 0: -    ans = 0 +        cnt += 1 +ans = 0 +if cnt % 2 == 0: +    print(ans) -    min_abs = abs(a[0]) -    ans = 0 +    tar = abs(a[0]) -        min_abs = min(min_abs, abs(a[i])) -    ans = ans - min_abs * 2 -print(ans) +        if tar > abs(a[i]): +            tar = abs(a[i]) +    print((ans - 2 * tar))