#include <bits/stdc++.h>
using namespace std;
void doRoutine() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
const long long int INF = 1e12;
signed main() {
  doRoutine();
  long long int n;
  cin >> n;
  vector<long long int> a(2 * n), b(2 * n);
  for (long long int i = 0; i < a.size(); i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  long long int ans = INF;
  for (long long int i = 0; i < a.size() - 1; i++) {
    for (long long int j = i + 1; j < a.size(); j++) {
      b = a;
      b.erase(b.begin() + i);
      b.erase(b.begin() + j - 1);
      long long int cur = 0;
      for (long long int i = 0; i < b.size(); i += 2) {
        cur += abs(b[i] - b[i + 1]);
      }
      ans = min(ans, cur);
    }
  }
  cout << ans << '\n';
  return 0;
}
