N = int(eval(input()))

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

cnt = 1

ans = 0

for i in range(N):

  if(A[i] < 0):

    cnt = cnt * (-1)

  elif(A[i] == 0):

    cnt = cnt * 0

if(cnt >= 0):

  for i in range(N):

    ans += abs(A[i])

else:

  for i in range(N):

    A[i] = abs(A[i])

  A.sort()

  for i in range(N):

    ans += A[i]

  ans -= A[0] * 2

print(ans)

N = int(eval(input()))

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

cnt = 0

ans = 0

for i in range(N):

  if(A[i] < 0):

    cnt += 1

if(cnt % 2 == 0):

  for i in range(N):

    ans += abs(A[i])

  print(ans)

else:

  minabs = 10**9

  for i in range(N):

    minabs = min(minabs, abs(A[i]))

  for i in range(N):

    ans += abs(A[i])

  print((ans - 2*minabs))
N = int(eval(input()))
A = list(map(int, input().split()))
cnt = 1
ans = 0
for i in range(N):
    if A[i] < 0:
        cnt = cnt * (-1)
    elif A[i] == 0:
        cnt = cnt * 0
if cnt >= 0:
    for i in range(N):
        ans += abs(A[i])
else:
    for i in range(N):
        A[i] = abs(A[i])
    A.sort()
    for i in range(N):
        ans += A[i]
    ans -= A[0] * 2
print(ans)

N = int(eval(input()))
A = list(map(int, input().split()))
cnt = 0
ans = 0
for i in range(N):
    if A[i] < 0:
        cnt += 1
if cnt % 2 == 0:
    for i in range(N):
        ans += abs(A[i])
    print(ans)
else:
    minabs = 10**9
    for i in range(N):
        minabs = min(minabs, abs(A[i]))
    for i in range(N):
        ans += abs(A[i])
    print((ans - 2 * minabs))

-cnt = 1 +cnt = 0 -        cnt = cnt * (-1) -    elif A[i] == 0: -        cnt = cnt * 0 -if cnt >= 0: +        cnt += 1 +if cnt % 2 == 0: +    print(ans) +    minabs = 10**9 -        A[i] = abs(A[i]) -    A.sort() +        minabs = min(minabs, abs(A[i])) -        ans += A[i] -    ans -= A[0] * 2 -print(ans) +        ans += abs(A[i]) +    print((ans - 2 * minabs))