#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e3;
const long long mod = 1e9 + 7;
const long long INF = 3e18 + 315;
long long n, w[maxn];
int32_t main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  for (long long i = 1; i <= 2 * n; i++) cin >> w[i];
  sort(w + 1, w + 1 + 2 * n);
  long long ans = INF;
  for (long long i = 1; i <= 2 * n; i++) {
    for (long long j = i + 1; j <= 2 * n; j++) {
      long long now = 0;
      long long cnt = 0;
      long long b[maxn];
      for (long long k = 1; k <= 2 * n; k++) {
        if (k == i || k == j) continue;
        b[++cnt] = w[k];
      }
      for (long long k = 1; k <= cnt; k += 2) {
        now += b[k + 1] - b[k];
      }
      ans = min(ans, now);
    }
  }
  cout << ans << endl;
  return 0;
}
