n = int(input())
a = list(map(int, input().split()))
a.sort()

res = []
low, up = a[0], a[-1]
for i in range(1, n-1):
    if a[i] < 0:
        res.append([up, low])
        up = up - low
        low = a[i]
    else:
        res.append([low, up])
        low = low - up
        up = a[i]

print(up-low)
res.append([up, low])

for v in res:
    print(*v) 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 res = [] res [] low, up = a[0], a[-1] low a[0] a 0 up a[-1] a -1 for i in range(1, n-1):
    if a[i] < 0:
        res.append([up, low])
        up = up - low
        low = a[i]
    else:
        res.append([low, up])
        low = low - up
        up = a[i] i range(1, n-1) range 1 n-1 n 1 if a[i] < 0:
        res.append([up, low])
        up = up - low
        low = a[i]
    else:
        res.append([low, up])
        low = low - up
        up = a[i] a[i] < 0 a[i] a i 0 res.append([up, low]) res.append res append [up, low] up low up = up - low up up - low up low low = a[i] low a[i] a i res.append([low, up]) res.append res append [low, up] low up low = low - up low low - up low up up = a[i] up a[i] a i print(up-low) print up-low up low res.append([up, low]) res.append res append [up, low] up low for v in res:
    print(*v) v res print(*v) print *v v up = a[i] a[i] up up = a[0], a[-1] a[-1] up low = a[i] a[i] low n = int(input()) int(input()) n res = [] [] res low, up = a[0], a[-1] a[0] low a = list(map(int, input().split())) list(map(int, input().split())) a low = low - up low - up low up = up - low up - low up
n = int(input())
a = list(map(int, input().split()))
a.sort()

res = []
low, up = a[0], a[-1]
for i in range(1, n-1):
    if a[i] < 0:
        res.append([up, low])
        up = up - low
        low = a[i]
    else:
        res.append([low, up])
        low = low - up
        up = a[i]

print(up-low)
res.append([up, low])

for v in res:
    print(*v)
