N,*A=map(int, open(0).read().split())
A.sort()
m,M=A[0],A[-1]
B=A[1:-1]
ans=[]
for b in B:
    if b>=0:
        ans.append((m,b))
        m-=b
    else:
        ans.append((M,b))
        M-=b
ans.append((M,m))
print(M-m)
for x,y in ans:
    print(x,y) N,*A=map(int, open(0).read().split()) N map(int, open(0).read().split()) map int open(0).read().split() (0).read().split (0).read() (0).read (0) open 0 read split *A A A.sort() A.sort A sort m,M=A[0],A[-1] m A[0] A 0 M A[-1] A -1 B=A[1:-1] B A[1:-1] A 1:-1 1 -1 ans=[] ans [] for b in B:
    if b>=0:
        ans.append((m,b))
        m-=b
    else:
        ans.append((M,b))
        M-=b b B if b>=0:
        ans.append((m,b))
        m-=b
    else:
        ans.append((M,b))
        M-=b b>=0 b 0 ans.append((m,b)) ans.append ans append (m,b) m b m-=b m b ans.append((M,b)) ans.append ans append (M,b) M b M-=b M b ans.append((M,m)) ans.append ans append (M,m) M m print(M-m) print M-m M m for x,y in ans:
    print(x,y) x y ans print(x,y) print x y M-=b b M B=A[1:-1] A[1:-1] B m-=b b m m,M=A[0],A[-1] A[0] m M=A[0],A[-1] A[-1] M ans=[] [] ans N,*A=map(int, open(0).read().split()) map(int, open(0).read().split()) N
N,*A=map(int, open(0).read().split())
A.sort()
m,M=A[0],A[-1]
B=A[1:-1]
ans=[]
for b in B:
    if b>=0:
        ans.append((m,b))
        m-=b
    else:
        ans.append((M,b))
        M-=b
ans.append((M,m))
print(M-m)
for x,y in ans:
    print(x,y)