#include <bits/stdc++.h>
using namespace std;
int n, ans = 99999999;
int v[200];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  n *= 2;
  for (int i = 1; i <= n; ++i) cin >> v[i];
  sort(v + 1, v + n + 1);
  for (int i = 1; i <= n; ++i) {
    for (int j = i + 1; j <= n; ++j) {
      int sum = 0;
      vector<int> val;
      for (int k = 1; k <= n; ++k) {
        if (k == i || k == j) continue;
        val.push_back(v[k]);
      }
      for (int k = 0; k < val.size() - 1; k += 2) sum += val[k + 1] - val[k];
      ans = min(ans, sum);
    }
  }
  cout << ans << "\n";
}
