#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[2 * n];
  vector<int> v;
  for (int i = 0; i < n * 2; ++i) cin >> arr[i];
  sort(arr, arr + (n * 2));
  int ans = 1e9;
  for (int i = 0; i < n * 2; ++i) {
    for (int j = i + 1; j < n * 2; ++j) {
      int prev = -1;
      int sum = 0;
      for (int k = 0; k < n * 2; ++k) {
        if (k == i || k == j) continue;
        if (prev == -1)
          prev = arr[k];
        else {
          sum += arr[k] - prev;
          prev = -1;
        }
      }
      ans = min(ans, sum);
    }
  }
  cout << ans;
  return 0;
}
