n=int(eval(input()))

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

a_s=sorted(a)

for i in range(0,n-1,2):

    if a_s[i]<0 and a_s[i+1]<0:

        a_s[i]=-a_s[i]

        a_s[i+1]=-a_s[i+1]

    elif a_s[i]<0 and -a_s[i]>a_s[i+1]:

        a_s[i]=-a_s[i]

        a_s[i+1]=-a_s[i+1]

    else:

        break

print((sum(a_s)))
n=int(eval(input()))

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

b=list(map(abs, a))

cnt = 0

for i in range(n):

    if a[i]<0:

        cnt+=1

if cnt%2==0:

    print((sum(b)))

else:

    print((sum(b)-2*min(b)))
n = int(eval(input()))
a = list(map(int, input().split()))
a_s = sorted(a)
for i in range(0, n - 1, 2):
    if a_s[i] < 0 and a_s[i + 1] < 0:
        a_s[i] = -a_s[i]
        a_s[i + 1] = -a_s[i + 1]
    elif a_s[i] < 0 and -a_s[i] > a_s[i + 1]:
        a_s[i] = -a_s[i]
        a_s[i + 1] = -a_s[i + 1]
    else:
        break
print((sum(a_s)))

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

-a_s = sorted(a) -for i in range(0, n - 1, 2): -    if a_s[i] < 0 and a_s[i + 1] < 0: -        a_s[i] = -a_s[i] -        a_s[i + 1] = -a_s[i + 1] -    elif a_s[i] < 0 and -a_s[i] > a_s[i + 1]: -        a_s[i] = -a_s[i] -        a_s[i + 1] = -a_s[i + 1] -    else: -        break -print((sum(a_s))) +b = list(map(abs, a)) +cnt = 0 +for i in range(n): +    if a[i] < 0: +        cnt += 1 +if cnt % 2 == 0: +    print((sum(b))) +else: +    print((sum(b) - 2 * min(b)))