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

A.sort()
S = sum(A)

if A[0] >= 0:
    print(S - A[0] * 2)
    tmp = A[0]
    for i in range(1, N - 1):
        print(tmp, A[i])
        tmp -= A[i]
    print(A[-1], tmp)

elif A[-1] <= 0:
    print(-S + A[-1] * 2)
    tmp = A[-1]
    for i in range(1, N):
        print(tmp, A[~i])
        tmp -= A[~i]

else:
    op = []
    tmp1 = A[-1]
    i = 1
    while A[i] < 0:
        op.append((tmp1, A[i]))
        tmp1 -= A[i]
        i += 1
    tmp2 = A[0]
    i = 1
    while A[~i] >= 0:
        op.append((tmp2, A[~i]))
        tmp2 -= A[~i]
        i += 1
    print(tmp1 - tmp2)
    for x, y in op:
        print(x, y)
    print(tmp1, tmp2) 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 S = sum(A) S sum(A) sum A if A[0] >= 0:
    print(S - A[0] * 2)
    tmp = A[0]
    for i in range(1, N - 1):
        print(tmp, A[i])
        tmp -= A[i]
    print(A[-1], tmp)

elif A[-1] <= 0:
    print(-S + A[-1] * 2)
    tmp = A[-1]
    for i in range(1, N):
        print(tmp, A[~i])
        tmp -= A[~i]

else:
    op = []
    tmp1 = A[-1]
    i = 1
    while A[i] < 0:
        op.append((tmp1, A[i]))
        tmp1 -= A[i]
        i += 1
    tmp2 = A[0]
    i = 1
    while A[~i] >= 0:
        op.append((tmp2, A[~i]))
        tmp2 -= A[~i]
        i += 1
    print(tmp1 - tmp2)
    for x, y in op:
        print(x, y)
    print(tmp1, tmp2) A[0] >= 0 A[0] A 0 0 print(S - A[0] * 2) print S - A[0] * 2 S A[0] * 2 A[0] A 0 2 tmp = A[0] tmp A[0] A 0 for i in range(1, N - 1):
        print(tmp, A[i])
        tmp -= A[i]
     i range(1, N - 1) range 1 N - 1 N 1 print(tmp, A[i]) print tmp A[i] A i tmp -= A[i] tmp A[i] A i print(A[-1], tmp) print A[-1] A -1 tmp elif A[-1] <= 0:
    print(-S + A[-1] * 2)
    tmp = A[-1]
    for i in range(1, N):
        print(tmp, A[~i])
        tmp -= A[~i] A[-1] <= 0 A[-1] A -1 0 print(-S + A[-1] * 2) print -S + A[-1] * 2 -S S A[-1] * 2 A[-1] A -1 2 tmp = A[-1] tmp A[-1] A -1 for i in range(1, N):
        print(tmp, A[~i])
        tmp -= A[~i] i range(1, N) range 1 N print(tmp, A[~i]) print tmp A[~i] A ~i i tmp -= A[~i] tmp A[~i] A ~i i op = [] op [] tmp1 = A[-1] tmp1 A[-1] A -1 i = 1 i 1 while A[i] < 0:
        op.append((tmp1, A[i]))
        tmp1 -= A[i]
        i += 1
     A[i] < 0 A[i] A i 0 op.append((tmp1, A[i])) op.append op append (tmp1, A[i]) tmp1 A[i] A i tmp1 -= A[i] tmp1 A[i] A i i += 1 i 1 tmp2 = A[0] tmp2 A[0] A 0 i = 1 i 1 while A[~i] >= 0:
        op.append((tmp2, A[~i]))
        tmp2 -= A[~i]
        i += 1
     A[~i] >= 0 A[~i] A ~i i 0 op.append((tmp2, A[~i])) op.append op append (tmp2, A[~i]) tmp2 A[~i] A ~i i tmp2 -= A[~i] tmp2 A[~i] A ~i i i += 1 i 1 print(tmp1 - tmp2) print tmp1 - tmp2 tmp1 tmp2 for x, y in op:
        print(x, y)
     x y op print(x, y) print x y print(tmp1, tmp2) print tmp1 tmp2 S = sum(A) sum(A) S op = [] [] op i = 1 1 i tmp = A[0] A[0] tmp i = 1 1 i i += 1 1 i N = int(input()) int(input()) N tmp1 -= A[i] A[i] tmp1 i += 1 1 i A = list(map(int, input().split())) list(map(int, input().split())) A tmp = A[-1] A[-1] tmp tmp -= A[i] A[i] tmp tmp2 = A[0] A[0] tmp2 tmp2 -= A[~i] A[~i] tmp2 tmp1 = A[-1] A[-1] tmp1 tmp -= A[~i] A[~i] tmp
N = int(input())
A = list(map(int, input().split()))

A.sort()
S = sum(A)

if A[0] >= 0:
    print(S - A[0] * 2)
    tmp = A[0]
    for i in range(1, N - 1):
        print(tmp, A[i])
        tmp -= A[i]
    print(A[-1], tmp)

elif A[-1] <= 0:
    print(-S + A[-1] * 2)
    tmp = A[-1]
    for i in range(1, N):
        print(tmp, A[~i])
        tmp -= A[~i]

else:
    op = []
    tmp1 = A[-1]
    i = 1
    while A[i] < 0:
        op.append((tmp1, A[i]))
        tmp1 -= A[i]
        i += 1
    tmp2 = A[0]
    i = 1
    while A[~i] >= 0:
        op.append((tmp2, A[~i]))
        tmp2 -= A[~i]
        i += 1
    print(tmp1 - tmp2)
    for x, y in op:
        print(x, y)
    print(tmp1, tmp2)