#include <bits/stdc++.h>
using namespace std;
int n;
int arr[200];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  for (int i = 0; i < 2 * n; ++i) cin >> arr[i];
  sort(arr, arr + 2 * n);
  int ns = 2 * n;
  int ans = INT_MAX, cur, prev;
  for (int i = 0; i < ns; ++i) {
    for (int j = i + 1; j < ns; ++j) {
      cur = 0;
      prev = -1;
      for (int k = 0; k < ns; ++k) {
        if (k == i || k == j) continue;
        if (prev == -1)
          prev = k;
        else {
          int tmp = arr[k] - arr[prev];
          cur += tmp;
          prev = -1;
        }
      }
      ans = min(ans, cur);
    }
  }
  cout << ans;
  return 0;
}
