#include <bits/stdc++.h>
using namespace std;
bool check(long long n, long long pos) { return (n & (1 << pos)); }
bool Set(long long n, long long pos) { return (n | (1 << pos)); }
long double LOG(long double b, long double e) { return log(b) / log(e); }
int tc = 1;
void solve(int kk) {
  int n, N;
  cin >> n, N = 2 * n;
  int a[N + 10], ans = 1e9;
  for (int i = 0; i < N; i++) cin >> a[i];
  sort(a, a + N);
  for (int i = 0; i < N; i++) {
    for (int j = i + 1; j < N; j++) {
      vector<int> v;
      for (int k = 0; k < N; k++) {
        if (k == i || k == j) continue;
        v.push_back(a[k]);
      }
      int hu = 0;
      for (int k = 0; k < n - 1; k++) {
        hu += v[2 * k + 1] - v[2 * k];
      }
      ans = min(ans, hu);
    }
  }
  cout << ans << "\n";
}
int main() {
  int kk = 0;
  while (++kk <= tc) solve(kk);
  return 0;
}
