#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(2 * n);
  for (int i = 0; i < 2 * n; i++) cin >> v[i];
  long long ans = LONG_MAX;
  for (int i = 0; i < v.size(); i++) {
    for (int j = i + 1; j < v.size(); j++) {
      vector<int> arr;
      for (int k = 0; k < v.size(); k++) {
        if (k == i || k == j)
          continue;
        else
          arr.push_back(v[k]);
      }
      sort(arr.begin(), arr.end());
      long long sm = 0;
      for (int k = 0; k < arr.size() - 1; k += 2)
        sm += abs(arr[k + 1] - arr[k]);
      ans = min(ans, sm);
    }
  }
  cout << ans << endl;
  return 0;
}
