#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, temp, i, ans = 0, j = 0, val, index, k = 0, final_ans = INT_MAX,
                  index_1, index_2;
  map<pair<int, int>, int> hash;
  cin >> n;
  vector<int> x(2 * n, 0), x1(n, 0);
  for (i = 0; i < 2 * n; i++) {
    cin >> temp;
    x[i] = temp;
  }
  sort(x.begin(), x.end());
  for (i = 0; i < 2 * n; i++) {
    for (j = i + 1; j < 2 * n; j++) {
      hash[make_pair(i, j)] = 1;
    }
  }
  for (auto iter : hash) {
    index_1 = iter.first.first;
    index_2 = iter.first.second;
    ans = 0;
    for (i = 0; i < x.size(); i++) {
      if (i == index_1 || i == index_2) continue;
      while (i + 1 == index_1 || i + 1 == index_2) {
        i++;
      }
      ans = ans + x[i + 1] - x[i];
      i++;
    }
    final_ans = min(ans, final_ans);
  }
  cout << final_ans << endl;
  return 0;
}
