N=int(eval(input()))

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

dp=[[0,0] for i in range(N)]

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

dp[0][1]=-1*dp[0][0]

for i in range(1,N-1):

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

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

print((max(dp[N-2])))
N=int(eval(input()))

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

A.sort()

idx=N

for i in range(N):

    if A[i]>0:

        idx=i

        break

if idx==0:

    print((sum(A)))

elif idx==N:

    print((sum(A[(N//2)*2:])-sum(A[:(N//2)*2])))

else:

    x=sum(A[(idx//2)*2:])-sum(A[:(idx//2)*2])

    y=sum(A[((idx+1)//2)*2:])-sum(A[:((idx+1)//2)*2])

    z=sum(A[(1+idx//2)*2:])-sum(A[:(1+idx//2)*2])

    print((max(x,y,z)))
N = int(eval(input()))
A = list(map(int, input().split()))
dp = [[0, 0] for i in range(N)]
dp[0][0] = A[0] + A[1]
dp[0][1] = -1 * dp[0][0]
for i in range(1, N - 1):
    dp[i][0] = max(dp[i - 1][0] + A[i + 1], dp[i - 1][1] + A[i + 1])
    dp[i][1] = max(
        dp[i - 1][0] - 2 * A[i] - A[i + 1], dp[i - 1][1] + 2 * A[i] - A[i + 1]
    )
print((max(dp[N - 2])))

N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
idx = N
for i in range(N):
    if A[i] > 0:
        idx = i
        break
if idx == 0:
    print((sum(A)))
elif idx == N:
    print((sum(A[(N // 2) * 2 :]) - sum(A[: (N // 2) * 2])))
else:
    x = sum(A[(idx // 2) * 2 :]) - sum(A[: (idx // 2) * 2])
    y = sum(A[((idx + 1) // 2) * 2 :]) - sum(A[: ((idx + 1) // 2) * 2])
    z = sum(A[(1 + idx // 2) * 2 :]) - sum(A[: (1 + idx // 2) * 2])
    print((max(x, y, z)))

-dp = [[0, 0] for i in range(N)] -dp[0][0] = A[0] + A[1] -dp[0][1] = -1 * dp[0][0] -for i in range(1, N - 1): -    dp[i][0] = max(dp[i - 1][0] + A[i + 1], dp[i - 1][1] + A[i + 1]) -    dp[i][1] = max( -        dp[i - 1][0] - 2 * A[i] - A[i + 1], dp[i - 1][1] + 2 * A[i] - A[i + 1] -    ) -print((max(dp[N - 2]))) +A.sort() +idx = N +for i in range(N): +    if A[i] > 0: +        idx = i +        break +if idx == 0: +    print((sum(A))) +elif idx == N: +    print((sum(A[(N // 2) * 2 :]) - sum(A[: (N // 2) * 2]))) +else: +    x = sum(A[(idx // 2) * 2 :]) - sum(A[: (idx // 2) * 2]) +    y = sum(A[((idx + 1) // 2) * 2 :]) - sum(A[: ((idx + 1) // 2) * 2]) +    z = sum(A[(1 + idx // 2) * 2 :]) - sum(A[: (1 + idx // 2) * 2]) +    print((max(x, y, z)))