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

AAA.sort()  # 昇順ソート

m = AAA[0]
M = AAA[N-1]
ANS = []

for i in range(1, N-1):
    if AAA[i] > 0:
        ANS.append((m, AAA[i]))
        m -= AAA[i]
        continue
    ANS.append((M, AAA[i]))
    M -= AAA[i]
ANS.append((M, m))

print(M-m)
for (x, y) in ANS:
    print(x, y) N = int(input()) N int(input()) int input() input AAA = list(map(int, input().split())) AAA list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split AAA.sort() AAA.sort AAA sort m = AAA[0] m AAA[0] AAA 0 M = AAA[N-1] M AAA[N-1] AAA N-1 N 1 ANS = [] ANS [] for i in range(1, N-1):
    if AAA[i] > 0:
        ANS.append((m, AAA[i]))
        m -= AAA[i]
        continue
    ANS.append((M, AAA[i]))
    M -= AAA[i] i range(1, N-1) range 1 N-1 N 1 if AAA[i] > 0:
        ANS.append((m, AAA[i]))
        m -= AAA[i]
        continue
     AAA[i] > 0 AAA[i] AAA i 0 ANS.append((m, AAA[i])) ANS.append ANS append (m, AAA[i]) m AAA[i] AAA i m -= AAA[i] m AAA[i] AAA i continue ANS.append((M, AAA[i])) ANS.append ANS append (M, AAA[i]) M AAA[i] AAA i M -= AAA[i] M AAA[i] AAA i ANS.append((M, m)) ANS.append ANS append (M, m) M m print(M-m) print M-m M m for (x, y) in ANS:
    print(x, y) (x, y) x y ANS print(x, y) print x y AAA = list(map(int, input().split())) list(map(int, input().split())) AAA m -= AAA[i] AAA[i] m N = int(input()) int(input()) N m = AAA[0] AAA[0] m M -= AAA[i] AAA[i] M M = AAA[N-1] AAA[N-1] M ANS = [] [] ANS
N = int(input())
AAA = list(map(int, input().split()))

AAA.sort()  # 昇順ソート

m = AAA[0]
M = AAA[N-1]
ANS = []

for i in range(1, N-1):
    if AAA[i] > 0:
        ANS.append((m, AAA[i]))
        m -= AAA[i]
        continue
    ANS.append((M, AAA[i]))
    M -= AAA[i]
ANS.append((M, m))

print(M-m)
for (x, y) in ANS:
    print(x, y)
