#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c* x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug& operator<<(const c&) {
    return *this;
  }
};
const long long N = 1e5 + 5;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  vector<long long> a(2 * n);
  for (long long i = 0; i < 2 * n; i++) cin >> a[i];
  vector<bool> vis(2 * n);
  long long ans = (long long)1e18 + 5;
  for (long long i = 0; i < 2 * n; i++) {
    for (long long j = i + 1; j < 2 * n; j++) {
      vis[i] = 1, vis[j] = 1;
      vector<long long> vv;
      for (long long k = 0; k < 2 * n; k++)
        if (!vis[k]) vv.push_back(a[k]);
      sort((vv).begin(), (vv).end());
      long long cur = 0;
      for (long long k = 0; k < 2 * n - 2; k += 2) {
        cur += abs(vv[k] - vv[k + 1]);
      }
      ans = min(ans, cur);
      vis[i] = 0, vis[j] = 0;
    }
  }
  cout << ans << "\n";
  return 0;
}
