#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  vector<int> w(n * 2);
  for (int i = 0; i < (int)(n * 2); ++i) scanf("%d", &w[i]);
  sort(w.begin(), w.end());
  int ans = 1e9 + 7;
  for (int i = 0; i < (int)(n * 2); ++i)
    for (int j = 0; j < (int)(i); ++j) {
      vector<int> nw;
      for (int k = 0; k < (int)(n * 2); ++k)
        if (k != i && k != j) nw.push_back(w[k]);
      int cur = 0;
      for (int k = 0; k < (int)(nw.size() - 1); ++k) {
        cur += nw[k + 1] - nw[k];
        ++k;
      }
      ans = min(ans, cur);
    }
  printf("%d\n", ans);
  return 0;
}
