N = int(eval(input()))

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



a, b = 0, -1e10

for ai in A:

    a, b = max(a + ai, b - ai), max(a - ai, b + ai)



print(a)
N = int(eval(input()))

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



B = [abs(a) for a in A]

if len([a for a in A if a < 0]) % 2 == 1:

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

else:

    print((sum(B)))

N = int(eval(input()))
A = [int(i) for i in input().split()]
a, b = 0, -1e10
for ai in A:
    a, b = max(a + ai, b - ai), max(a - ai, b + ai)
print(a)

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

-a, b = 0, -1e10 -for ai in A: -    a, b = max(a + ai, b - ai), max(a - ai, b + ai) -print(a) +B = [abs(a) for a in A] +if len([a for a in A if a < 0]) % 2 == 1: +    print((sum(B) - 2 * min(B))) +else: +    print((sum(B)))