#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 30;
const long long INF = 1ll << 60;
const double pi = acos(-1);
const double eps = 1e-9;
const long long mod = 1e9 + 7;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
int n;
vector<int> a;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  int N = 2 * n;
  a = vector<int>(N);
  for (int i = 0; i < N; i++) cin >> a[i];
  sort(a.begin(), a.end());
  int res = inf;
  for (int i = 0; i < N; i += 2)
    for (int j = i + 1; j < N; j += 2) {
      int t = 0;
      for (int k = 0; k < i; k += 2) t += a[k + 1] - a[k];
      for (int k = i + 1; k < j; k += 2) t += a[k + 1] - a[k];
      for (int k = j + 1; k < N; k += 2) t += a[k + 1] - a[k];
      res = min(res, t);
    }
  cout << res << endl;
}
