# 最後の計算で(max)-(min)が必要
# max: 最大値 - ∑負の数
# min: 最小値 - ∑正の数

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

ans = []
low = A[0]
high = A[-1]

for a in A[1:-1]:
    if a > 0:
        ans.append((low, a))
        low = low - a
    else:
        ans.append((high, a))
        high = high - a

ans.append((high, low))

print(high - low)
for (x, y) in ans:
    print(x, y) 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 ans = [] ans [] low = A[0] low A[0] A 0 high = A[-1] high A[-1] A -1 for a in A[1:-1]:
    if a > 0:
        ans.append((low, a))
        low = low - a
    else:
        ans.append((high, a))
        high = high - a a A[1:-1] A 1:-1 1 -1 if a > 0:
        ans.append((low, a))
        low = low - a
    else:
        ans.append((high, a))
        high = high - a a > 0 a 0 ans.append((low, a)) ans.append ans append (low, a) low a low = low - a low low - a low a ans.append((high, a)) ans.append ans append (high, a) high a high = high - a high high - a high a ans.append((high, low)) ans.append ans append (high, low) high low print(high - low) print high - low high low for (x, y) in ans:
    print(x, y) (x, y) x y ans print(x, y) print x y N = int(input()) int(input()) N low = A[0] A[0] low high = high - a high - a high ans = [] [] ans high = A[-1] A[-1] high A = list(map(int, input().split())) list(map(int, input().split())) A low = low - a low - a low
# 最後の計算で(max)-(min)が必要
# max: 最大値 - ∑負の数
# min: 最小値 - ∑正の数

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

ans = []
low = A[0]
high = A[-1]

for a in A[1:-1]:
    if a > 0:
        ans.append((low, a))
        low = low - a
    else:
        ans.append((high, a))
        high = high - a

ans.append((high, low))

print(high - low)
for (x, y) in ans:
    print(x, y)