

function Main(input) {
  input = input.split("\n");
  var N = parseInt(input[0]);
  var A = input[1].split(" ").map(i => parseInt(i));
  A.sort(function(a,b){return a-b});
  var anssub=[0];
  if(A[0]<=0&&A[A.length-1]>=0){
    var min=A[0];
    var max=A[A.length-1];
    A.splice(0,1);
    A.splice(A.length-1,1);
    for(var i=0;i<A.length;i++){
      if(A[i]<=0){
        anssub.push(max+" "+A[i]);
        max=max-A[i];
      }else{
        anssub.push(min+" "+A[i]);
        min=min-A[i];
      }
    }
    anssub.push(max+" "+min);
    anssub[0]=max-min;
  }else if(A[0]<0){
    var max=A[A.length-1]-A[0];
    anssub.push(A[A.length-1]+" "+A[0]);
    for(var i=1;i<N-2;i++){
      anssub.push(max+" "+A[i]);
      max=max-A[i];
    }
    anssub.push(max+" "+A[A.length-2]);
    anssub[0]=max-A[A.length-2];
  }else{
    var min=A[0]-A[A.length-1];
    anssub.push(A[0]+" "+A[A.length-1]);
    for(var i=1;i<N-2;i++){
      anssub.push(min+" "+A[i]);
      min=min-A[i];
    }
    anssub.push(A[A.length-2]+" "+min);
    anssub[0]=A[A.length-2]-min;
  }
  ans=anssub.join("\n");

  console.log('%s', ans);
  return ans;
}

function debug(n){
  var input = document.getElementById("input"+n).value;
  var ans=Main(input);
  var result="WA";
  if(ans==document.getElementById("output"+n).value.split("\n")[0]){
    result="AC";
  }
  document.getElementById("result"+n).innerHTML=result;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));