N = int(input())
a = list(map(int, input().split()))
a.sort()
t = 0
for m in range(N):
    if a[m] < 0:
        t += 1
if N > 2:
    if t == 0:
        c = a[0]
        for i in range(N - 2):
            c = c - a[N - 1 - i]
        d = a[1] - c
        print(d)
        e = a[0]
        f = a[N - 1]
        for j in range(N - 2):
            print(e, end = ' ')
            print(f)
            e = e - f
            f = a[N - 2 - j]
        print(a[1], end = ' ')
        print(e)
    elif t > 0 and t < N - 1:
        c = 0
        for i in range(t):
            c += a[i] 
        for j in range(N - t -1):
            c = c - a[t + 1 + j]
        d = a[t] - c
        print(d)
        e = a[0]
        f = a[N - 1]
        for k in range(N - t - 1):
            print(e, end = ' ')
            print(f)
            e = e - f
            f = a[N - 2 - k]
        a[0] = e
        g = a[t]
        for l in range(t):
            print(g, end = ' ')
            print(a[l])
            g = g - a[l]
    elif t == N - 1 or t == N:
        c = a[N - 1]
        for i in range(N - 1):
            c = c - a[i]
        print(c)
        d = a[N - 1]
        for j in range(N - 1):
            print(d, end = ' ')
            print(a[j])
            d -= a[j]
else:
    print(a[1] - a[0])
    print(a[1], end = ' ')
    print(a[0]) 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 t = 0 t 0 for m in range(N):
    if a[m] < 0:
        t += 1 m range(N) range N if a[m] < 0:
        t += 1 a[m] < 0 a[m] a m 0 t += 1 t 1 if N > 2:
    if t == 0:
        c = a[0]
        for i in range(N - 2):
            c = c - a[N - 1 - i]
        d = a[1] - c
        print(d)
        e = a[0]
        f = a[N - 1]
        for j in range(N - 2):
            print(e, end = ' ')
            print(f)
            e = e - f
            f = a[N - 2 - j]
        print(a[1], end = ' ')
        print(e)
    elif t > 0 and t < N - 1:
        c = 0
        for i in range(t):
            c += a[i] 
        for j in range(N - t -1):
            c = c - a[t + 1 + j]
        d = a[t] - c
        print(d)
        e = a[0]
        f = a[N - 1]
        for k in range(N - t - 1):
            print(e, end = ' ')
            print(f)
            e = e - f
            f = a[N - 2 - k]
        a[0] = e
        g = a[t]
        for l in range(t):
            print(g, end = ' ')
            print(a[l])
            g = g - a[l]
    elif t == N - 1 or t == N:
        c = a[N - 1]
        for i in range(N - 1):
            c = c - a[i]
        print(c)
        d = a[N - 1]
        for j in range(N - 1):
            print(d, end = ' ')
            print(a[j])
            d -= a[j]
else:
    print(a[1] - a[0])
    print(a[1], end = ' ')
    print(a[0]) N > 2 N 2 if t == 0:
        c = a[0]
        for i in range(N - 2):
            c = c - a[N - 1 - i]
        d = a[1] - c
        print(d)
        e = a[0]
        f = a[N - 1]
        for j in range(N - 2):
            print(e, end = ' ')
            print(f)
            e = e - f
            f = a[N - 2 - j]
        print(a[1], end = ' ')
        print(e)
    elif t > 0 and t < N - 1:
        c = 0
        for i in range(t):
            c += a[i] 
        for j in range(N - t -1):
            c = c - a[t + 1 + j]
        d = a[t] - c
        print(d)
        e = a[0]
        f = a[N - 1]
        for k in range(N - t - 1):
            print(e, end = ' ')
            print(f)
            e = e - f
            f = a[N - 2 - k]
        a[0] = e
        g = a[t]
        for l in range(t):
            print(g, end = ' ')
            print(a[l])
            g = g - a[l]
    elif t == N - 1 or t == N:
        c = a[N - 1]
        for i in range(N - 1):
            c = c - a[i]
        print(c)
        d = a[N - 1]
        for j in range(N - 1):
            print(d, end = ' ')
            print(a[j])
            d -= a[j] t == 0 t 0 c = a[0] c a[0] a 0 for i in range(N - 2):
            c = c - a[N - 1 - i]
         i range(N - 2) range N - 2 N 2 c = c - a[N - 1 - i] c c - a[N - 1 - i] c a[N - 1 - i] a N - 1 - i N - 1 N 1 i d = a[1] - c d a[1] - c a[1] a 1 c print(d) print d e = a[0] e a[0] a 0 f = a[N - 1] f a[N - 1] a N - 1 N 1 for j in range(N - 2):
            print(e, end = ' ')
            print(f)
            e = e - f
            f = a[N - 2 - j]
         j range(N - 2) range N - 2 N 2 print(e, end = ' ') print e end = ' ' end ' ' print(f) print f e = e - f e e - f e f f = a[N - 2 - j] f a[N - 2 - j] a N - 2 - j N - 2 N 2 j print(a[1], end = ' ') print a[1] a 1 end = ' ' end ' ' print(e) print e elif t > 0 and t < N - 1:
        c = 0
        for i in range(t):
            c += a[i] 
        for j in range(N - t -1):
            c = c - a[t + 1 + j]
        d = a[t] - c
        print(d)
        e = a[0]
        f = a[N - 1]
        for k in range(N - t - 1):
            print(e, end = ' ')
            print(f)
            e = e - f
            f = a[N - 2 - k]
        a[0] = e
        g = a[t]
        for l in range(t):
            print(g, end = ' ')
            print(a[l])
            g = g - a[l]
     t > 0 and t < N - 1 t > 0 t 0 t < N - 1 t N - 1 N 1 c = 0 c 0 for i in range(t):
            c += a[i] 
         i range(t) range t c += a[i] c a[i] a i for j in range(N - t -1):
            c = c - a[t + 1 + j]
         j range(N - t -1) range N - t -1 N - t N t 1 c = c - a[t + 1 + j] c c - a[t + 1 + j] c a[t + 1 + j] a t + 1 + j t + 1 t 1 j d = a[t] - c d a[t] - c a[t] a t c print(d) print d e = a[0] e a[0] a 0 f = a[N - 1] f a[N - 1] a N - 1 N 1 for k in range(N - t - 1):
            print(e, end = ' ')
            print(f)
            e = e - f
            f = a[N - 2 - k]
         k range(N - t - 1) range N - t - 1 N - t N t 1 print(e, end = ' ') print e end = ' ' end ' ' print(f) print f e = e - f e e - f e f f = a[N - 2 - k] f a[N - 2 - k] a N - 2 - k N - 2 N 2 k a[0] = e a[0] a 0 e g = a[t] g a[t] a t for l in range(t):
            print(g, end = ' ')
            print(a[l])
            g = g - a[l]
     l range(t) range t print(g, end = ' ') print g end = ' ' end ' ' print(a[l]) print a[l] a l g = g - a[l] g g - a[l] g a[l] a l elif t == N - 1 or t == N:
        c = a[N - 1]
        for i in range(N - 1):
            c = c - a[i]
        print(c)
        d = a[N - 1]
        for j in range(N - 1):
            print(d, end = ' ')
            print(a[j])
            d -= a[j] t == N - 1 or t == N t == N - 1 t N - 1 N 1 t == N t N c = a[N - 1] c a[N - 1] a N - 1 N 1 for i in range(N - 1):
            c = c - a[i]
         i range(N - 1) range N - 1 N 1 c = c - a[i] c c - a[i] c a[i] a i print(c) print c d = a[N - 1] d a[N - 1] a N - 1 N 1 for j in range(N - 1):
            print(d, end = ' ')
            print(a[j])
            d -= a[j] j range(N - 1) range N - 1 N 1 print(d, end = ' ') print d end = ' ' end ' ' print(a[j]) print a[j] a j d -= a[j] d a[j] a j print(a[1] - a[0]) print a[1] - a[0] a[1] a 1 a[0] a 0 print(a[1], end = ' ') print a[1] a 1 end = ' ' end ' ' print(a[0]) print a[0] a 0 c = c - a[N - 1 - i] c - a[N - 1 - i] c d = a[t] - c a[t] - c d c = c - a[i] c - a[i] c c = c - a[t + 1 + j] c - a[t + 1 + j] c c = 0 0 c g = a[t] a[t] g e = e - f e - f e e = a[0] a[0] e e = e - f e - f e e = a[0] a[0] e f = a[N - 1] a[N - 1] f g = g - a[l] g - a[l] g f = a[N - 2 - j] a[N - 2 - j] f f = a[N - 2 - k] a[N - 2 - k] f d -= a[j] a[j] d N = int(input()) int(input()) N d = a[1] - c a[1] - c d t = 0 0 t t += 1 1 t c = a[N - 1] a[N - 1] c f = a[N - 1] a[N - 1] f c += a[i] a[i] c d = a[N - 1] a[N - 1] d a = list(map(int, input().split())) list(map(int, input().split())) a c = a[0] a[0] c
N = int(input())
a = list(map(int, input().split()))
a.sort()
t = 0
for m in range(N):
    if a[m] < 0:
        t += 1
if N > 2:
    if t == 0:
        c = a[0]
        for i in range(N - 2):
            c = c - a[N - 1 - i]
        d = a[1] - c
        print(d)
        e = a[0]
        f = a[N - 1]
        for j in range(N - 2):
            print(e, end = ' ')
            print(f)
            e = e - f
            f = a[N - 2 - j]
        print(a[1], end = ' ')
        print(e)
    elif t > 0 and t < N - 1:
        c = 0
        for i in range(t):
            c += a[i] 
        for j in range(N - t -1):
            c = c - a[t + 1 + j]
        d = a[t] - c
        print(d)
        e = a[0]
        f = a[N - 1]
        for k in range(N - t - 1):
            print(e, end = ' ')
            print(f)
            e = e - f
            f = a[N - 2 - k]
        a[0] = e
        g = a[t]
        for l in range(t):
            print(g, end = ' ')
            print(a[l])
            g = g - a[l]
    elif t == N - 1 or t == N:
        c = a[N - 1]
        for i in range(N - 1):
            c = c - a[i]
        print(c)
        d = a[N - 1]
        for j in range(N - 1):
            print(d, end = ' ')
            print(a[j])
            d -= a[j]
else:
    print(a[1] - a[0])
    print(a[1], end = ' ')
    print(a[0])