# util functions

# debug
$debugFlag = ( ARGV[0] != nil )
p "==== DEBUG MODE ====" if $debugFlag

def pd(str)
  p str if $debugFlag
end

def printd(str)
  print str if $debugFlag
end

# input
inputs = []
lc = 0
nn = 0
while l = $stdin.gets do
  if lc == 0
    nn = l.chomp.to_i
  else
    inputs = l.chomp.split(" ").map(&:to_i)
  end
  lc += 1
end

# body
if $debugFlag
  p nn
  p inputs
end

inputs.sort!

neg_exists = (inputs[0] < 0)
pos_exists = (inputs[-1] > 0)

pd inputs

ans = 0
ansseq = []
if neg_exists
  if pos_exists
    inputs.reverse!
    ans = inputs[-1]
    for i in 0..inputs.length-2 do
      if inputs[i] >= 0
        if inputs[i+1] < 0
          ansseq << "#{inputs[i]} #{ans}"
          ans = inputs[i] - ans
        else
          ansseq << "#{ans} #{inputs[i]}"
          ans -= inputs[i]
        end
      else
        ansseq << "#{ans} #{inputs[i]}"
        ans -= inputs[i]
      end
    end
  else
    inputs.reverse!
    ans = inputs[0]
    for i in 1..inputs.length-1 do
      if i == inputs.length-1
        ansseq << "#{ans} #{inputs[i]}"        
        ans -= inputs[i]
      else
        ansseq << "#{ans} #{inputs[i]}"        
        ans -= inputs[i]
      end
    end
  end
else
  if pos_exists
    ans = inputs[0]
    for i in 1..inputs.length-1 do
      if i == inputs.length-1
        ansseq << "#{inputs[i]} #{ans}"        
        ans = inputs[i] - ans
      else
        ansseq << "#{ans} #{inputs[i]}"        
        ans -= inputs[i]
      end
    end
  else
    ans = 0
  end
end
    
puts ans
ansseq.each do |a_i|
  puts a_i
end
