#include <bits/stdc++.h>
using namespace std;
set<long long> gera_primos(long long n) {
  set<long long> primos;
  vector<bool> crivo(n);
  primos.insert(2);
  for (long long i = 3; i <= n; i += 2) {
    if (crivo[i]) continue;
    primos.insert(i);
    for (long long j = i; j <= n; j += i) {
      crivo[j] = true;
    }
  }
  return primos;
}
struct Link {
  long long from, to, cost;
};
struct Node {
  bool visitado = false;
  set<long long> out;
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  n *= 2;
  vector<long long> a(n);
  for (auto &x : a) cin >> x;
  sort(a.begin(), a.end());
  long long minimo = (long long)1e18;
  for (long long l = 0; l < (long long)n; l++) {
    for (long long r = l + 1; r < (long long)n; r++) {
      long long i = 0;
      long long total = 0;
      vector<long long> aux;
      for (long long i = 0; i < (long long)n; i++) {
        if (i != l and i != r) aux.push_back(a[i]);
      }
      while (i < n - 2) {
        long long dif = abs(aux[i + 1] - aux[i]);
        total += dif;
        i += 2;
      }
      minimo = min(total, minimo);
    }
  }
  printf("%lld\n", minimo);
}
