#include <bits/stdc++.h>
using namespace std;
void fl() {}
int main() {
  fl();
  int a[101], n, mnIns = 99999999;
  cin >> n, n *= 2;
  for (int i = 0; i < n and cin >> a[i]; i++)
    ;
  sort(a, a + n);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (i != j) {
        int ans = 0, f = -1, s = -1;
        for (int k = 0; k < n; k++) {
          if (k == i or k == j) continue;
          if (f == -1)
            f = a[k];
          else if (s == -1)
            s = a[k];
          else
            ans += (s - f), f = -1, s = -1, k--;
        }
        if (f != -1 and s != -1) ans += (s - f);
        mnIns = min(mnIns, ans);
      }
  cout << mnIns;
  return 0;
}
