n=int(eval(input()))

l=[*list(map(int,input().split()))]

c=0

for e,i in enumerate(l):

  if i<0:

    c+=1

    l[e]=-i

print((sum(l)-[0,min(l)*2][c%2]))
n=int(eval(input()))

a=[*list(map(int,input().split()))]

l=[*list(map(abs,a))]

print((sum(l)-sum(i<0 for i in a)%2*min(l)*2))
n = int(eval(input()))
l = [*list(map(int, input().split()))]
c = 0
for e, i in enumerate(l):
    if i < 0:
        c += 1
        l[e] = -i
print((sum(l) - [0, min(l) * 2][c % 2]))

n = int(eval(input()))
a = [*list(map(int, input().split()))]
l = [*list(map(abs, a))]
print((sum(l) - sum(i < 0 for i in a) % 2 * min(l) * 2))

-l = [*list(map(int, input().split()))] -c = 0 -for e, i in enumerate(l): -    if i < 0: -        c += 1 -        l[e] = -i -print((sum(l) - [0, min(l) * 2][c % 2])) +a = [*list(map(int, input().split()))] +l = [*list(map(abs, a))] +print((sum(l) - sum(i < 0 for i in a) % 2 * min(l) * 2))