#include <bits/stdc++.h>
using namespace std;
template <class T>
bool umin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool umax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
int arr[100009], n;
int main() {
  int ans = 1000000007;
  scanf("%d", &n);
  for (int i = 1; i <= n * 2; i++) scanf("%d", arr + i);
  sort(arr + 1, arr + n * 2 + 1);
  for (int i = 1; i <= n * 2; i++)
    for (int j = i + 1; j <= n * 2; j++) {
      int res = 0, last = -1;
      for (int k = 1; k <= n * 2; k++) {
        if (k == i or k == j) continue;
        if (~last) {
          res += arr[k] - last;
          last = -1;
        } else
          last = arr[k];
      }
      umin(ans, res);
    }
  printf("%d\n", ans);
  return 0;
}
