N = int(eval(input()))

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

ans = 0

m = 10 ** 9 #絶対値の最小

c = 0 #マイナスの数

for i in range(N):

  ans += abs(A[i])

  if m > abs(A[i]):

    m = abs(A[i])

  if A[i] < 0: c += 1

print((ans if c % 2 == 0 else ans - 2 * m))
N = int(eval(input()))

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



cnt = 0

for i in range(N):

    if A[i] < 0:cnt += 1

if cnt % 2 == 0:

    print((sum([abs(x) for x in A])))

else:

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

    print((sum(a) - min(a)*2))
N = int(eval(input()))
A = list(map(int, input().split()))
ans = 0
m = 10**9  # 絶対値の最小
c = 0  # マイナスの数
for i in range(N):
    ans += abs(A[i])
    if m > abs(A[i]):
        m = abs(A[i])
    if A[i] < 0:
        c += 1
print((ans if c % 2 == 0 else ans - 2 * m))

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

-ans = 0 -m = 10**9  # 絶対値の最小 -c = 0  # マイナスの数 +cnt = 0 -    ans += abs(A[i]) -    if m > abs(A[i]): -        m = abs(A[i]) -        c += 1 -print((ans if c % 2 == 0 else ans - 2 * m)) +        cnt += 1 +if cnt % 2 == 0: +    print((sum([abs(x) for x in A]))) +else: +    a = [abs(x) for x in A] +    print((sum(a) - min(a) * 2))