#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  vector<int> w;
  cin >> n;
  for (int i = 0; i < 2 * n; i++) {
    int x;
    cin >> x;
    w.push_back(x);
  }
  long long int m = INT_MAX;
  for (int i = 0; i < w.size(); i++) {
    for (int j = i + 1; j < w.size(); j++) {
      vector<int> temp;
      for (int k = 0; k < w.size(); k++) {
        if (k != i and k != j) {
          temp.push_back(w[k]);
        }
      }
      sort(temp.begin(), temp.end());
      long long int sum = 0;
      for (int k = 1; k < temp.size(); k += 2) {
        sum += (temp[k] - temp[k - 1]);
      }
      m = min(m, sum);
    }
  }
  cout << m << endl;
}
