#include <bits/stdc++.h>
using namespace std;
int main() {
  int arr[10005], n, i, k, l, cek, mn = 1e9, tm = 0;
  cin >> n;
  for (i = 0; i < 2 * n; i++) {
    cin >> arr[i];
  }
  k = 2 * n;
  sort(arr + 0, arr + k);
  for (i = 0; i < k; i++) {
    int cek1 = n - 1;
    tm = 0;
    for (int j = i + 1; j < k; j++) {
      vector<int> v;
      tm = 0;
      for (l = 0; l < k; l++) {
        if (l == i || l == j) continue;
        v.push_back(arr[l]);
      }
      sort(v.begin(), v.end());
      for (l = 0; l < v.size(); l += 2) tm += v[l + 1] - v[l];
      mn = min(mn, tm);
    }
  }
  cout << mn << endl;
  return 0;
}
