#include <bits/stdc++.h>
using namespace std;
const long long M = 1e18;
int main() {
  int total = 0, maxD = INT_MAX;
  int n;
  cin >> n;
  int *arr = new int[2 * n];
  for (int i = 0; i < 2 * n; i++) {
    cin >> arr[i];
  }
  sort(arr, arr + 2 * n);
  int a, b, k;
  for (int i = 0; i < 2 * n; i++) {
    for (int j = i + 1; j < 2 * n; j++) {
      int ten = 0;
      k = 0;
      a = 0, b = 1;
      while (k < n - 1) {
        if (a == i || a == j) {
          a++;
          if (a == i || a == j) a++;
        }
        b = a + 1;
        if (b == i || b == j) {
          b++;
          if (b == i || b == j) b++;
        }
        ten += abs(arr[a] - arr[b]);
        a = b + 1;
        k++;
      }
      maxD = min(maxD, ten);
    }
  }
  cout << maxD;
  return 0;
}
