N, *A = list(map(int, open(0).read().split()))



dp = [[0] * 2 for _ in range(N + 1)]

dp[0][1] = -float('inf')



for i in range(N):

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

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

    

print((dp[N][0]))





N = int(eval(input()))

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



y = [abs(v) for v in X]

if sum(v < 0 for v in X) % 2 == 0:

    print((sum(y)))

else:

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

N, *A = list(map(int, open(0).read().split()))
dp = [[0] * 2 for _ in range(N + 1)]
dp[0][1] = -float("inf")
for i in range(N):
    dp[i + 1][0] = max(dp[i][0] + A[i], dp[i][1] - A[i])
    dp[i + 1][1] = max(dp[i][0] - A[i], dp[i][1] + A[i])
print((dp[N][0]))

N = int(eval(input()))
X = list(map(int, input().split()))
y = [abs(v) for v in X]
if sum(v < 0 for v in X) % 2 == 0:
    print((sum(y)))
else:
    print((sum(y) - 2 * min(y)))

-N, *A = list(map(int, open(0).read().split())) -dp = [[0] * 2 for _ in range(N + 1)] -dp[0][1] = -float("inf") -for i in range(N): -    dp[i + 1][0] = max(dp[i][0] + A[i], dp[i][1] - A[i]) -    dp[i + 1][1] = max(dp[i][0] - A[i], dp[i][1] + A[i]) -print((dp[N][0])) +N = int(eval(input())) +X = list(map(int, input().split())) +y = [abs(v) for v in X] +if sum(v < 0 for v in X) % 2 == 0: +    print((sum(y))) +else: +    print((sum(y) - 2 * min(y)))