There are N integers, A_1, A_2, ..., A_N, written on a blackboard.  We will repeat the following operation N-1 times so that we have only one integer on the blackboard.    * Choose two integers x and y on the blackboard and erase these two integers. Then, write a new integer x-y.  Find the maximum possible value of the final integer on the blackboard and a sequence of operations that maximizes the final integer.
n = int(input())
arr = list(map(int, input().split()))
arr.sort(reverse=True)
ans = []
while len(arr) != 1:
  x = arr.pop()
  y = arr.pop()
  ans.append([x, y])
  arr.append((x-y))
  arr.sort(reverse=True)
print(abs(arr[0]))  
[print(x, y) for x, y in ans]
n = int(input())
arr = sorted(list(map(int, input().split())))

m = arr[0]
M = arr[-1]
S = []
for a in arr[1:-1]:
  if a > 0:
    S.append(str(m) + ' ' + str(a))
    m -= a
  else:
    S.append(str(M) + ' ' + str(a))
    M -= a
S.append(str(M) + ' ' + str(m))
print(M-m)
[print(s) for s in S]

