#include <bits/stdc++.h>
using namespace std;
void file(string name) {
  ios_base::sync_with_stdio(0), cin.tie(0);
  freopen((name + ".in").c_str(), "r", stdin);
  freopen((name + ".out").c_str(), "w", stdout);
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  int n, v[105], best = 0x3f3f3f3f;
  cin >> n;
  n *= 2;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  sort(v, v + n);
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      int soma = 0;
      vector<int> atual;
      for (int z = 0; z < n; z++) {
        if (z == i || z == j) continue;
        atual.push_back(v[z]);
      }
      for (int z = 0; z < (int)atual.size(); z += 2) {
        soma += (atual[z + 1] - atual[z]);
      }
      best = min(best, soma);
    }
  }
  cout << best << '\n';
  return 0;
}
