
n = gets.to_i
as = gets.split.map {|x| x.to_i}


as.sort!

$str = ""
def set(x,y)
  $str += "#{x} #{y}\n"
  return x - y
end

if as[0] < 0 and as[-1] < 0
  p = as[-1]
  i = n - 2
  while i > 0
    p = set(p, as[i])
    i-=1
  end
  v = set(p, as[0])
  puts v
elsif as[0] > 0 and as[-1] > 0
  m = as[0]
  i = 1
  while i < n - 1
    m = set(m, as[i])
    i+=1
  end
  v = set(as[-1],m)
  puts v
else
  i = 1
  m = as[0]
  p = as[-1]
  while i < n - 1
    if as[i] > 0
      m = set(m,as[i])
    else
      p = set(p,as[i])
    end
    i+=1
  end

  v = set(p,m)
  puts v
end
  

print $str

