N = int(eval(input()))

A = [0] + list(map(int, input().split()))



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

# dp[i][j]: j=0 -> A[1] + ... + A[i] の MAX

#           j=1 -> A[i] and A[i+1] を反転させた状態での和の最大値



dp[0][0] = 0

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



for i in range(N):

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

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



print((dp[N][0]))
N = int(eval(input()))

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

abss = [abs(A[i]) for i in range(N)]

minus = [A[i] for i in range(N) if A[i] < 0]

if len(minus) % 2 == 0:

    ans = sum([abs(A[i]) for i in range(N)])

    print(ans)

else:

    abss.sort()

    ans = -abss[0] + sum(abss[1:])

    print(ans)

    
N = int(eval(input()))
A = [0] + list(map(int, input().split()))
dp = [[0, 0] for _ in range(N + 1)]
# dp[i][j]: j=0 -> A[1] + ... + A[i] の MAX
#           j=1 -> A[i] and A[i+1] を反転させた状態での和の最大値
dp[0][0] = 0
dp[0][1] = -float("inf")
for i in range(N):
    dp[i + 1][0] = max(dp[i][0] + A[i + 1], dp[i][1] - A[i + 1])
    dp[i + 1][1] = max(dp[i][0] - A[i + 1], dp[i][1] + A[i + 1])
print((dp[N][0]))

N = int(eval(input()))
A = list(map(int, input().split()))
abss = [abs(A[i]) for i in range(N)]
minus = [A[i] for i in range(N) if A[i] < 0]
if len(minus) % 2 == 0:
    ans = sum([abs(A[i]) for i in range(N)])
    print(ans)
else:
    abss.sort()
    ans = -abss[0] + sum(abss[1:])
    print(ans)

-A = [0] + list(map(int, input().split())) -dp = [[0, 0] for _ in range(N + 1)] -# dp[i][j]: j=0 -> A[1] + ... + A[i] の MAX -#           j=1 -> A[i] and A[i+1] を反転させた状態での和の最大値 -dp[0][0] = 0 -dp[0][1] = -float("inf") -for i in range(N): -    dp[i + 1][0] = max(dp[i][0] + A[i + 1], dp[i][1] - A[i + 1]) -    dp[i + 1][1] = max(dp[i][0] - A[i + 1], dp[i][1] + A[i + 1]) -print((dp[N][0])) +A = list(map(int, input().split())) +abss = [abs(A[i]) for i in range(N)] +minus = [A[i] for i in range(N) if A[i] < 0] +if len(minus) % 2 == 0: +    ans = sum([abs(A[i]) for i in range(N)]) +    print(ans) +else: +    abss.sort() +    ans = -abss[0] + sum(abss[1:]) +    print(ans)