#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[100];
  int b[100];
  int i1, j1, n, i, j, k, l, m, o, min, sum;
  cin >> n;
  n = 2 * n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  min = 10000;
  std::sort(a, a + n);
  for (i = 0; i < n - 1; i++) {
    for (j = i + 1; j < n; j++) {
      i1 = a[i];
      j1 = a[j];
      a[i] = 0;
      a[j] = 0;
      o = 0;
      k = 0;
      while (k < n) {
        if (a[k] == 0)
          o++;
        else
          b[k - o] = a[k];
        k++;
      }
      sum = 0;
      for (k = 0; k <= n - 3; k = k + 2) {
        sum += abs(b[k] - b[k + 1]);
      }
      if (sum < min) min = sum;
      a[i] = i1;
      a[j] = j1;
    }
  }
  cout << min << endl;
}
