import sys input = sys.stdin.readline N=int(input()) A=list(map(int,input().split())) A.sort() def calc(x,y): if x<0 and y<0: return -x-y else: return abs(x-y) def calc2(A): score=0 for i in range(N-1): x,y=A[i],A[i+1] score+=calc(x,y) return score MIN=calc2(A) ind=A[:] MINUS=[] OTHER=[] for a in A: if a<0: MINUS.append(a) else: OTHER.append(a) B=[-1]*len(OTHER) f=0 l=len(B)-1 for i in range(len(OTHER)): if i%2==0: B[f]=OTHER[i] f+=1 else: B[l]=OTHER[i] l-=1 B=[MINUS[0]]+B+MINUS[1:][::-1] score2=calc2(B) if score2