#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e6 + 5;
const int mod = 1000000007;
vector<int> v;
int a[N];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= 2 * n; i++) scanf("%d", &a[i]);
  int ans = mod;
  for (int i = 1; i <= n + n; i++)
    for (int j = i + 1; j <= n + n; j++) {
      v.clear();
      for (int k = 1; k <= n + n; k++) {
        if (k == i || k == j) continue;
        v.push_back(a[k]);
      }
      sort(v.begin(), v.end());
      int temp = 0;
      for (int k = 0; k < v.size(); k += 2) temp += v[k + 1] - v[k];
      ans = min(temp, ans);
    }
  printf("%d ", ans);
  printf("\n");
  return 0;
}
