n = int(eval(input()))

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

new_a = []

sum = 0

minus_count = 0

zero_flag = 0



for i in range(n):

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



for i in range(n):

	if a[i] < 0:

		minus_count += 1

	if a[i] == 0:

		zero_flag = 1



if zero_flag == 1:

	for i in range(n):

		sum += abs(a[i])

elif minus_count % 2 == 0:

	for i in range(n):

		sum += abs(a[i])

else:

	for i in range(n):

		sum += new_a[i]

	sum = sum - min(new_a) * 2



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

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

new_a = []

sum = 0

minus_count = 0



for i in range(n):

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



for i in range(n):

	if a[i] < 0:

		minus_count += 1



if minus_count % 2 == 0:

	for i in range(n):

		sum += abs(a[i])

else:

	for i in range(n):

		sum += new_a[i]

	sum = sum - min(new_a) * 2



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

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

-zero_flag = 0 -    if a[i] == 0: -        zero_flag = 1 -if zero_flag == 1: -    for i in range(n): -        sum += abs(a[i]) -elif minus_count % 2 == 0: +if minus_count % 2 == 0: