N = int(input())

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

A.sort()

npl = A[-1]
nmi = A[0]

del A[0]
del A[-1]
lis = []

for i in A:

    if i < 0:
        lis.append([npl,i])
        npl -= i

    else:
        lis.append([nmi,i])
        nmi -= i

lis.append([npl,nmi])
print (npl-nmi)

for i in lis:

    print (i[0],i[1]) N = int(input()) N int(input()) int input() input A = list(map(int,input().split())) A list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split A.sort() A.sort A sort npl = A[-1] npl A[-1] A -1 nmi = A[0] nmi A[0] A 0 del A[0] A[0] A 0 del A[-1] A[-1] A -1 lis = [] lis [] for i in A:

    if i < 0:
        lis.append([npl,i])
        npl -= i

    else:
        lis.append([nmi,i])
        nmi -= i i A if i < 0:
        lis.append([npl,i])
        npl -= i

    else:
        lis.append([nmi,i])
        nmi -= i i < 0 i 0 lis.append([npl,i]) lis.append lis append [npl,i] npl i npl -= i npl i lis.append([nmi,i]) lis.append lis append [nmi,i] nmi i nmi -= i nmi i lis.append([npl,nmi]) lis.append lis append [npl,nmi] npl nmi print (npl-nmi) print npl-nmi npl nmi for i in lis:

    print (i[0],i[1]) i lis print (i[0],i[1]) print i[0] i 0 i[1] i 1 lis = [] [] lis npl = A[-1] A[-1] npl nmi -= i i nmi N = int(input()) int(input()) N npl -= i i npl A = list(map(int,input().split())) list(map(int,input().split())) A nmi = A[0] A[0] nmi
N = int(input())

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

A.sort()

npl = A[-1]
nmi = A[0]

del A[0]
del A[-1]
lis = []

for i in A:

    if i < 0:
        lis.append([npl,i])
        npl -= i

    else:
        lis.append([nmi,i])
        nmi -= i

lis.append([npl,nmi])
print (npl-nmi)

for i in lis:

    print (i[0],i[1])
