N = gets.to_i
A = gets.split.map &:to_i
minuses, pluses = A.partition{|a| a < 0 }
minuses.sort!.reverse!
pluses.sort!

ans = []
if pluses.empty?
  a, b = minuses.shift(2)
  c = a - b
  ans << [a, b]
  pluses.unshift c
elsif minuses.empty?
  a, b = pluses.shift(2)
  c = a - b
  ans << [a, b]
  minuses.unshift c
end

while minuses.size >= 1 && pluses.size >= 1
  a = minuses.shift
  b = pluses.shift
  if pluses.empty?
    c = b - a
    ans << [b, a]
    pluses.unshift c
  else
    c = a - b
    ans << [a, b]
    minuses.unshift c
  end
end

p pluses[0] || -minuses[0]
puts ans.map{|a| a*' ' }
