N = int(input())
A = list(map(int, input().split()))
A.sort()
a = A[0]
b = A[-1]
xy = []
for i in range(1, N-1):
    if A[i] > 0:
        xy.append((a, A[i]))
        a -= A[i]
    else:
        xy.append((b, A[i]))
        b -= A[i]
xy.append((b, a))
print(b-a)
for x, y in xy:
    print(x, y) 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 a = A[0] a A[0] A 0 b = A[-1] b A[-1] A -1 xy = [] xy [] for i in range(1, N-1):
    if A[i] > 0:
        xy.append((a, A[i]))
        a -= A[i]
    else:
        xy.append((b, A[i]))
        b -= A[i] i range(1, N-1) range 1 N-1 N 1 if A[i] > 0:
        xy.append((a, A[i]))
        a -= A[i]
    else:
        xy.append((b, A[i]))
        b -= A[i] A[i] > 0 A[i] A i 0 xy.append((a, A[i])) xy.append xy append (a, A[i]) a A[i] A i a -= A[i] a A[i] A i xy.append((b, A[i])) xy.append xy append (b, A[i]) b A[i] A i b -= A[i] b A[i] A i xy.append((b, a)) xy.append xy append (b, a) b a print(b-a) print b-a b a for x, y in xy:
    print(x, y) x y xy print(x, y) print x y b -= A[i] A[i] b N = int(input()) int(input()) N b = A[-1] A[-1] b a -= A[i] A[i] a a = A[0] A[0] a xy = [] [] xy A = list(map(int, input().split())) list(map(int, input().split())) A
N = int(input())
A = list(map(int, input().split()))
A.sort()
a = A[0]
b = A[-1]
xy = []
for i in range(1, N-1):
    if A[i] > 0:
        xy.append((a, A[i]))
        a -= A[i]
    else:
        xy.append((b, A[i]))
        b -= A[i]
xy.append((b, a))
print(b-a)
for x, y in xy:
    print(x, y)