#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
const long long mod = 1e9 + 7;
const int oo = 1e9;
int n;
int t[N];
int ans = oo;
void solve(int i, int last, int skip, int curr) {
  if (skip > 2) return;
  if (curr > ans) return;
  if (n == i) {
    ans = min(ans, curr);
    return;
  }
  if (last != 0)
    solve(i + 1, 0, skip, curr + abs(last - t[i]));
  else
    solve(i + 1, t[i], skip, curr);
  solve(i + 1, last, skip + 1, curr);
}
int main() {
  scanf("%d", &n);
  n *= 2;
  for (int i = 0; i <= n - 1; i++) scanf("%d", &t[i]);
  sort(t, t + n);
  solve(0, 0, 0, 0);
  printf("%d", ans);
}
