n = int(eval(input()))

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



cnt = 0

for a in A:

    if a < 0:

        cnt += 1



C = [abs(a) for a in A]

C.sort(reverse=True)

if cnt%2 == 0:

    print((sum(C)))

else:

    C[-1] *= (-1)

    print((sum(C)))
n = int(eval(input()))

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



dp = [[0]*2 for _ in range(n)]

# dp[i][0]:*1

# dp[i][1]:*(-1)

for i in range(n-1):

    if i == 0:

        dp[i+1][0] += A[i]

        dp[i+1][1] += -A[i]

    else:

        dp[i+1][0] = max(dp[i][0]+A[i], dp[i][1]+(-1)*A[i])

        dp[i+1][1] = max(dp[i][0]+(-1)*A[i], dp[i][1]+A[i])

ans = max(dp[n-1][0]+A[n-1], dp[n-1][1]+(-1)*A[n-1])

print(ans)

n = int(eval(input()))
A = list(map(int, input().split()))
cnt = 0
for a in A:
    if a < 0:
        cnt += 1
C = [abs(a) for a in A]
C.sort(reverse=True)
if cnt % 2 == 0:
    print((sum(C)))
else:
    C[-1] *= -1
    print((sum(C)))

n = int(eval(input()))
A = list(map(int, input().split()))
dp = [[0] * 2 for _ in range(n)]
# dp[i][0]:*1
# dp[i][1]:*(-1)
for i in range(n - 1):
    if i == 0:
        dp[i + 1][0] += A[i]
        dp[i + 1][1] += -A[i]
    else:
        dp[i + 1][0] = max(dp[i][0] + A[i], dp[i][1] + (-1) * A[i])
        dp[i + 1][1] = max(dp[i][0] + (-1) * A[i], dp[i][1] + A[i])
ans = max(dp[n - 1][0] + A[n - 1], dp[n - 1][1] + (-1) * A[n - 1])
print(ans)

-cnt = 0 -for a in A: -    if a < 0: -        cnt += 1 -C = [abs(a) for a in A] -C.sort(reverse=True) -if cnt % 2 == 0: -    print((sum(C))) -else: -    C[-1] *= -1 -    print((sum(C))) +dp = [[0] * 2 for _ in range(n)] +# dp[i][0]:*1 +# dp[i][1]:*(-1) +for i in range(n - 1): +    if i == 0: +        dp[i + 1][0] += A[i] +        dp[i + 1][1] += -A[i] +    else: +        dp[i + 1][0] = max(dp[i][0] + A[i], dp[i][1] + (-1) * A[i]) +        dp[i + 1][1] = max(dp[i][0] + (-1) * A[i], dp[i][1] + A[i]) +ans = max(dp[n - 1][0] + A[n - 1], dp[n - 1][1] + (-1) * A[n - 1]) +print(ans)