#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
  int n;
  cin >> n;
  int arr[2 * n];
  for (int i = 0; i < 2 * n; i++) {
    cin >> arr[i];
  }
  sort(arr, arr + 2 * n);
  int min_total = 100000000;
  for (int i = 0; i < 2 * n; i++) {
    for (int j = i + 1; j < 2 * n; j++) {
      vector<int> people;
      for (int k = 0; k < 2 * n; k++) {
        if (k != i && k != j) {
          people.push_back(arr[k]);
        }
      }
      int temp = 0;
      for (int index = 0; index < people.size() - 1; index = index + 2) {
        temp += (people[index + 1] - people[index]);
      }
      if (temp < min_total) {
        min_total = temp;
      }
    }
  }
  cout << min_total << '\n';
  return 0;
}
