N = int(eval(input()))

A = sorted([int(_) for _ in input().split()])

ans = sum(A)

for i in range(1, N // 2 + 1):

    a1 = ans - 2 * (A[2 * i - 2] + A[2 * i - 1])

    if a1 < ans:

        break

    ans = a1

print(ans)

N = int(eval(input()))

A = [int(_) for _ in input().split()]

cnt = sum(a < 0 for a in A)

sumabs = sum(abs(a) for a in A)

if cnt % 2 == 0:

    print(sumabs)

else:

    print((sumabs - 2 * min(abs(a) for a in A)))

N = int(eval(input()))
A = sorted([int(_) for _ in input().split()])
ans = sum(A)
for i in range(1, N // 2 + 1):
    a1 = ans - 2 * (A[2 * i - 2] + A[2 * i - 1])
    if a1 < ans:
        break
    ans = a1
print(ans)

N = int(eval(input()))
A = [int(_) for _ in input().split()]
cnt = sum(a < 0 for a in A)
sumabs = sum(abs(a) for a in A)
if cnt % 2 == 0:
    print(sumabs)
else:
    print((sumabs - 2 * min(abs(a) for a in A)))

-A = sorted([int(_) for _ in input().split()]) -ans = sum(A) -for i in range(1, N // 2 + 1): -    a1 = ans - 2 * (A[2 * i - 2] + A[2 * i - 1]) -    if a1 < ans: -        break -    ans = a1 -print(ans) +A = [int(_) for _ in input().split()] +cnt = sum(a < 0 for a in A) +sumabs = sum(abs(a) for a in A) +if cnt % 2 == 0: +    print(sumabs) +else: +    print((sumabs - 2 * min(abs(a) for a in A)))