#include <bits/stdc++.h>
using namespace std;
const int MN = 1e2 + 6;
int n, result = MN * 1000;
int data[MN];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cin >> n;
  n *= 2;
  for (int i = 1; i <= n; i++) cin >> data[i];
  sort(data + 1, data + n + 1);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (i == j) continue;
      ;
      ;
      ;
      int res = 0;
      int prev = 0, first_p = 1;
      for (int k = 1; k <= n; k++) {
        if (k == i || k == j) continue;
        if (first_p) {
          prev = data[k];
          first_p = 0;
        } else {
          res += data[k] - prev;
          first_p = 1;
        };
      }
      result = min(res, result);
    }
  }
  cout << result << endl;
  return 0;
}
