#include <bits/stdc++.h>
using namespace std;
int a[110];
int b[11000];
int main() {
  int n;
  cin >> n;
  n <<= 1;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int ans = 0x3f3f3f3f;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      vector<int> v;
      for (int k = 0; k < n; k++) {
        if (i != k && j != k) {
          v.push_back(a[k]);
        }
      }
      sort(v.begin(), v.end());
      int temp = 0;
      for (int k = 1; k < int(v.size()); k += 2) {
        temp += abs(v[k] - v[k - 1]);
      }
      ans = min(ans, temp);
    }
  }
  cout << ans << endl;
  return 0;
}
