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

A.sort()

for i,a in enumerate(A):
    if a>=0:break
B = A[:i]
C = A[i:]

ans = []
if not B:
    x = C[0]
    for a in C[1:-1]:
        ans.append((x,a))
        x -= a
    ans.append((C[-1],x))
    x = C[-1] - x
elif not C:
    x = B[-1]
    for a in B[:-1]:
        ans.append((x,a))
        x -= a
else:
    x = B[0]
    for a in C[1:]:
        ans.append((x,a))
        x -= a
    ans.append((C[0],x))
    x = C[0]-x
    for a in B[1:]:
        ans.append((x,a))
        x -= a

print(x)
for out in ans:
    print(*out) N = int(input()) N int(input()) int input() input *A, = map(int,input().split()) *A A map(int,input().split()) map int input().split() ().split () input split A.sort() A.sort A sort for i,a in enumerate(A):
    if a>=0:break i a enumerate(A) enumerate A if a>=0:b a>=0 a 0 B = A[:i] B A[:i] A :i i C = A[i:] C A[i:] A i: i ans = [] ans [] if not B:
    x = C[0]
    for a in C[1:-1]:
        ans.append((x,a))
        x -= a
    ans.append((C[-1],x))
    x = C[-1] - x
elif not C:
    x = B[-1]
    for a in B[:-1]:
        ans.append((x,a))
        x -= a
else:
    x = B[0]
    for a in C[1:]:
        ans.append((x,a))
        x -= a
    ans.append((C[0],x))
    x = C[0]-x
    for a in B[1:]:
        ans.append((x,a))
        x -= a not B B x = C[0] x C[0] C 0 for a in C[1:-1]:
        ans.append((x,a))
        x -= a
     a C[1:-1] C 1:-1 1 -1 ans.append((x,a)) ans.append ans append (x,a) x a x -= a x a ans.append((C[-1],x)) ans.append ans append (C[-1],x) C[-1] C -1 x x = C[-1] - x x C[-1] - x C[-1] C -1 x elif not C:
    x = B[-1]
    for a in B[:-1]:
        ans.append((x,a))
        x -= a not C C x = B[-1] x B[-1] B -1 for a in B[:-1]:
        ans.append((x,a))
        x -= a a B[:-1] B :-1 -1 ans.append((x,a)) ans.append ans append (x,a) x a x -= a x a x = B[0] x B[0] B 0 for a in C[1:]:
        ans.append((x,a))
        x -= a
     a C[1:] C 1: 1 ans.append((x,a)) ans.append ans append (x,a) x a x -= a x a ans.append((C[0],x)) ans.append ans append (C[0],x) C[0] C 0 x x = C[0]-x x C[0]-x C[0] C 0 x for a in B[1:]:
        ans.append((x,a))
        x -= a a B[1:] B 1: 1 ans.append((x,a)) ans.append ans append (x,a) x a x -= a x a print(x) print x for out in ans:
    print(*out) out ans print(*out) print *out out B = A[:i] A[:i] B N = int(input()) int(input()) N x = C[-1] - x C[-1] - x x x = B[0] B[0] x x -= a a x x = C[0]-x C[0]-x x x -= a a x x -= a a x x = C[0] C[0] x x -= a a x ans = [] [] ans C = A[i:] A[i:] C x = B[-1] B[-1] x
N = int(input())
*A, = map(int,input().split())

A.sort()

for i,a in enumerate(A):
    if a>=0:break
B = A[:i]
C = A[i:]

ans = []
if not B:
    x = C[0]
    for a in C[1:-1]:
        ans.append((x,a))
        x -= a
    ans.append((C[-1],x))
    x = C[-1] - x
elif not C:
    x = B[-1]
    for a in B[:-1]:
        ans.append((x,a))
        x -= a
else:
    x = B[0]
    for a in C[1:]:
        ans.append((x,a))
        x -= a
    ans.append((C[0],x))
    x = C[0]-x
    for a in B[1:]:
        ans.append((x,a))
        x -= a

print(x)
for out in ans:
    print(*out)