#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,sse3,sse4,popcnt,abm,mmx")
using namespace std;
int a[100];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  n *= 2;
  for (int i = 0; i < n; ++i) cin >> a[i];
  sort(a, a + n);
  int mn = 1e9;
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      int res = 0;
      for (int k = 0, r = 1; k < n && r < n;) {
        if (k == i || k == j) {
          k++;
          continue;
        }
        while (r < n && (r == i || r == j || r <= k)) {
          r++;
        }
        if (r == n) break;
        res += abs(a[k] - a[r]);
        k = r + 1;
      }
      mn = min(res, mn);
    }
  }
  cout << mn;
  return 0;
}
