N,*as=$<.read.split.map(&:to_i)

as.sort!
ret = []

if 0 < as[0] * as[-1]
  if N == 2
    plus = as[-1]
    minus = as[0]
    as = []
  else
    ret << [as[0], as[-1]]
    if as[0] < 0
      plus = as[0] - as[-1]
      minus = as[1]
    else
      plus = as[1]
      minus = as[0] - as[-1]
    end
    as = as[2..-2]
  end
else
  plus = as[-1]
  minus = as[0]
  as = as[1..-2]
end

as.each do |a|
  if a < 0
    ret << [plus, a]
    plus -= a
  else
    ret << [minus, a]
    minus -= a
  end
end

ret << [plus, minus]

p (plus-minus)
ret.each do|a,b|
  puts "#{a} #{b}"
end
