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

XY=[]
left,right=A[0],A[-1]
for i in range(1,n-1):
    num=A[i]
    if num<0:
        XY.append([right,num])
        right -=num
    else:
        XY.append([left,num])
        left -=num
XY.append([right,left])
print(right-left)
for x,y in XY:print(x,y) n=int(input()) n int(input()) int input() input A=sorted(list(map(int,input().split()))) A sorted(list(map(int,input().split()))) sorted list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split XY=[] XY [] left,right=A[0],A[-1] left A[0] A 0 right A[-1] A -1 for i in range(1,n-1):
    num=A[i]
    if num<0:
        XY.append([right,num])
        right -=num
    else:
        XY.append([left,num])
        left -=num i range(1,n-1) range 1 n-1 n 1 num=A[i] num A[i] A i if num<0:
        XY.append([right,num])
        right -=num
    else:
        XY.append([left,num])
        left -=num num<0 num 0 XY.append([right,num]) XY.append XY append [right,num] right num right -=num right num XY.append([left,num]) XY.append XY append [left,num] left num left -=num left num XY.append([right,left]) XY.append XY append [right,left] right left print(right-left) print right-left right left for x,y in XY:print(x,y) x y XY right -=num num right A=sorted(list(map(int,input().split()))) sorted(list(map(int,input().split()))) A right=A[0],A[-1] A[-1] right left,right=A[0],A[-1] A[0] left n=int(input()) int(input()) n XY=[] [] XY num=A[i] A[i] num left -=num num left
n=int(input())
A=sorted(list(map(int,input().split())))

XY=[]
left,right=A[0],A[-1]
for i in range(1,n-1):
    num=A[i]
    if num<0:
        XY.append([right,num])
        right -=num
    else:
        XY.append([left,num])
        left -=num
XY.append([right,left])
print(right-left)
for x,y in XY:print(x,y)