n=int(input())
a=list(map(int,input().split()))
a.sort()
xy=[]
for i in range(n-2,0,-1):
  y=a[i]
  if y>0:
    x=a[0]
    a[0]-=y
  else:
    x=a[n-1]
    a[n-1]-=y
  xy.append((x,y))
print(a[n-1]-a[0])
xy.append((a[n-1],a[0]))
print('\n'.join([' '.join(map(str,t)) for t in xy])) 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 xy=[] xy [] for i in range(n-2,0,-1):
  y=a[i]
  if y>0:
    x=a[0]
    a[0]-=y
  else:
    x=a[n-1]
    a[n-1]-=y
  xy.append((x,y)) i range(n-2,0,-1) range n-2 n 2 0 -1 y=a[i] y a[i] a i if y>0:
    x=a[0]
    a[0]-=y
  else:
    x=a[n-1]
    a[n-1]-=y
   y>0 y 0 x=a[0] x a[0] a 0 a[0]-=y a[0] a 0 y x=a[n-1] x a[n-1] a n-1 n 1 a[n-1]-=y a[n-1] a n-1 n 1 y xy.append((x,y)) xy.append xy append (x,y) x y print(a[n-1]-a[0]) print a[n-1]-a[0] a[n-1] a n-1 n 1 a[0] a 0 xy.append((a[n-1],a[0])) xy.append xy append (a[n-1],a[0]) a[n-1] a n-1 n 1 a[0] a 0 ' '.join(map(str,t)) for t in xy for t in xy t xy for t in xy ' '.join(map(str,t)) ' '.join ' ' join map(str,t) map str t print('\n'.join([' '.join(map(str,t)) for t in xy])) print '\n'.join([' '.join(map(str,t)) for t in xy]) '\n'.join '\n' join [' '.join(map(str,t)) for t in xy] n=int(input()) int(input()) n x=a[0] a[0] x y=a[i] a[i] y a=list(map(int,input().split())) list(map(int,input().split())) a x=a[n-1] a[n-1] x xy=[] [] xy
n=int(input())
a=list(map(int,input().split()))
a.sort()
xy=[]
for i in range(n-2,0,-1):
  y=a[i]
  if y>0:
    x=a[0]
    a[0]-=y
  else:
    x=a[n-1]
    a[n-1]-=y
  xy.append((x,y))
print(a[n-1]-a[0])
xy.append((a[n-1],a[0]))
print('\n'.join([' '.join(map(str,t)) for t in xy]))