#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  n = 2 * n;
  int i, j;
  int a[100];
  for (i = 0; i < n; i++) cin >> a[i];
  int k;
  int mini = 10000000;
  for (i = 0; i < n; i++) {
    for (j = i + 1; j < n; j++) {
      vector<int> v;
      for (k = 0; k < n; k++) {
        if (k != i && k != j) v.push_back(a[k]);
      }
      sort(v.begin(), v.end());
      int cnt = 0;
      for (k = 0; k < v.size(); k = k + 2) {
        cnt = cnt + v[k + 1] - v[k];
      }
      mini = min(mini, cnt);
    }
  }
  if (n == 2)
    cout << "0\n";
  else
    cout << mini << "\n";
}
