n=int(eval(input()))

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

k=[]

t=0

ans=0

for i in range(n):

  ans+=abs(d[i])

  if d[i]<=0:

    t+=1

for i in range(len(d)):

  k.append(abs(d[i]))

k.sort()

if t%2:

  ans-=2*k[0]

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

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

count=0

ans=[]

for i in range(n):

  ans.append(abs(a[i]))

  if a[i]<0:

    count+=1



if count%2==0:

  print((sum(ans)))

else:

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

  
n = int(eval(input()))
d = list(map(int, input().split()))
k = []
t = 0
ans = 0
for i in range(n):
    ans += abs(d[i])
    if d[i] <= 0:
        t += 1
for i in range(len(d)):
    k.append(abs(d[i]))
k.sort()
if t % 2:
    ans -= 2 * k[0]
print(ans)

n = int(eval(input()))
a = list(map(int, input().split()))
count = 0
ans = []
for i in range(n):
    ans.append(abs(a[i]))
    if a[i] < 0:
        count += 1
if count % 2 == 0:
    print((sum(ans)))
else:
    print((sum(ans) - 2 * min(ans)))

-d = list(map(int, input().split())) -k = [] -t = 0 -ans = 0 +a = list(map(int, input().split())) +count = 0 +ans = [] -    ans += abs(d[i]) -    if d[i] <= 0: -        t += 1 -for i in range(len(d)): -    k.append(abs(d[i])) -k.sort() -if t % 2: -    ans -= 2 * k[0] -print(ans) +    ans.append(abs(a[i])) +    if a[i] < 0: +        count += 1 +if count % 2 == 0: +    print((sum(ans))) +else: +    print((sum(ans) - 2 * min(ans)))