#include <bits/stdc++.h>
using namespace std;
const int oo{1000000007};
int instability(int N, const vector<int>& xs) {
  auto res = 0;
  for (int i = 0; i < N; ++i) res += (xs[2 * i + 1] - xs[2 * i]);
  return res;
}
int solve(int N, vector<int>& xs) {
  sort(xs.begin(), xs.end());
  int ans = oo;
  for (int a = 0; a < 2 * N; ++a)
    for (int b = a + 1; b < 2 * N; ++b) {
      vector<int> ys;
      for (int i = 0; i < 2 * N; ++i)
        if (i != a and i != b) ys.push_back(xs[i]);
      ans = min(ans, instability(N - 1, ys));
    }
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  vector<int> xs(2 * N);
  for (int i = 0; i < 2 * N; ++i) cin >> xs[i];
  auto ans = solve(N, xs);
  cout << ans << '\n';
  return 0;
}
