n=int(eval(input()))

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

b=[abs(x) for x in a]

ret=0

for i in range(n):

  if a[i]!=b[i]:

    ret+=1

ans=sum(b)

if ret%2:

  ans-=2*min(b)

print(ans)
n=int(eval(input()))

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

neg_sum=sum(x<0 for x in a)

a=list([abs(x) for x in a])

m=min(a)

s=sum(a)

if neg_sum%2 : s-=m*2

print(s)
n = int(eval(input()))
a = list(map(int, input().split()))
b = [abs(x) for x in a]
ret = 0
for i in range(n):
    if a[i] != b[i]:
        ret += 1
ans = sum(b)
if ret % 2:
    ans -= 2 * min(b)
print(ans)

n = int(eval(input()))
a = list(map(int, input().split()))
neg_sum = sum(x < 0 for x in a)
a = list([abs(x) for x in a])
m = min(a)
s = sum(a)
if neg_sum % 2:
    s -= m * 2
print(s)

-b = [abs(x) for x in a] -ret = 0 -for i in range(n): -    if a[i] != b[i]: -        ret += 1 -ans = sum(b) -if ret % 2: -    ans -= 2 * min(b) -print(ans) +neg_sum = sum(x < 0 for x in a) +a = list([abs(x) for x in a]) +m = min(a) +s = sum(a) +if neg_sum % 2: +    s -= m * 2 +print(s)