function pint(s)   { return parseInt(s);   }                                                                                                                                                                function pfloat(s) { return parseFloat(s); }
function even(s)   { return (s % 2) === 0; }                                                                                                                                                                function odd(s)    { return (s % 2) === 1; }
function add(a, b) { return a + b; }
Array.prototype.sortNumAsc  = function ()  { return this.sort((a, b) => (a - b)); };
Array.prototype.sortNumDesc = function ()  { return this.sort((a, b) => (b - a)); };
Array.prototype.sortStrAsc  = function ()  { return this.sort();                  };
Array.prototype.sortStrDesc = function ()  { return this.sort().reverse();        };                                                                                                                        Array.prototype.without     = function (x) { return this.filter(e => e !== x);    };
Array.prototype.orderdPush  = function (x) {                                                                                                                                                                  var s = 0;                                                                                                                                                                                                  var e = this.length;                                                                                                                                                                                        while(s !== e) {                                                                                                                                                                                              var c = (s + e) >> 1;                                                                                                                                                                                       if (this[c] < x) s = c + 1;                                                                                                                                                                                 else e = c;                                                                                                                                                                                               }
  this.splice(s, 0, x);                                                                                                                                                                                       return x;                                                                                                                                                                                                 }                                                                                                                                                                                                           function main(lines) {                                                                                                                                                                                        var N = pint(lines[0].trim());
  var list = lines[1].split(' ').map(function(n){return pint(n.trim())});                                                                                                                                     var lList = list.slice(0, N).sortNumAsc();                                                                                                                                                                  var lMax = lList.reduce(add, 0);                                                                                                                                                                            var rList = list.slice(2*N).sortNumAsc();                                                                                                                                                                   var rMin = rList.reduce(add, 0);                                                                                                                                                                            var leftMaxs  = [lMax];                                                                                                                                                                                     var rightMins = [rMin];                                                                                                                                                                                     for (var lk = N, N3 = N*3; lk < 2*N; lk++) {                                                                                                                                                                    var l = list[lk];                                                                                                                                                                                           lList.orderdPush(l);                                                                                                                                                                                        lMax += l;
      var min = lList.shift();                                                                                                                                                                                    lMax -= min;
      leftMaxs.push(lMax);                                                                                                                                                                                        var rk = (N3 - lk - 1);                                                                                                                                                                                     var r = list[rk];                                                                                                                                                                                           rList.orderdPush(r);                                                                                                                                                                                        rMin += r;
      var max = rList.pop();                                                                                                                                                                                      rMin -= max;
      rightMins.unshift(rMin);                                                                                                                                                                                }
  var A = -Infinity;                                                                                                                                                                                          for (var i = 0; i < N+1; i++) {                                                                                                                                                                               var x = leftMaxs[i] - rightMins[i];                                                                                                                                                                         if (A < x) {
      A = x;                                                                                                                                                                                                    }
  }                                                                                                                                                                                                           console.log(A);
}                                                                                                                                                                                                           main(require("fs").readFileSync("/dev/stdin", "utf8").split('\n').map(l => l.trim()));