#include <bits/stdc++.h>
using namespace std;
int n;
int p[300];
int main() {
  int i, k, j, l;
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (i = 0; i < 2 * n; i++) {
    cin >> p[i];
  }
  n *= 2;
  int result = 200000000;
  for (i = 0; i < n; i++) {
    for (j = i + 1; j < n; j++) {
      vector<int> V;
      for (k = 0; k < n; k++) {
        if (k != i && k != j) {
          V.push_back(p[k]);
        }
      }
      sort(V.begin(), V.end());
      int sum = 0;
      for (l = 0; l < V.size(); l = l + 2) {
        sum += (V[l + 1] - V[l]);
      }
      result = min(result, sum);
    }
  }
  cout << result << endl;
  return 0;
}
