#include <bits/stdc++.h>
using namespace std;
const long long MOD = (int)1e9 + 7;
void file() {
  freopen("asd.txt", "r", stdin);
  freopen("asden.txt", "w", stdout);
}
int dx[] = {1, -1, 0, 0, 1, -1, 1, -1};
int dy[] = {0, 0, -1, 1, 1, -1, -1, 1};
const int MAX = (int)1e5 + 10;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL), cout.tie(NULL);
  ;
  int n;
  cin >> n;
  vector<int> v(2 * n);
  for (int i = 0; i < 2 * n; i++) cin >> v[i];
  sort(((v).rbegin()), ((v).rend()));
  int res = (int)2e9;
  for (int i = 0; i < 2 * n; i++)
    for (int j = i + 1; j < 2 * n; j++) {
      bool ok = false;
      int sm = 0;
      for (int ii = 0; ii < 2 * n; ii++) {
        if (i == ii || j == ii) continue;
        if (!ok) {
          ok = true;
          continue;
        }
        ok = false;
        sm += v[ii - 1] - v[ii];
      }
      res = min(res, sm);
    }
  cout << res << endl;
  return 0;
}
