#include <bits/stdc++.h>
using namespace std;
bool used[100] = {};
void solveProblem(int &a, int &b, int forbid1, int forbid2) {
  while (a == forbid1 || a == forbid2 || used[a] || a == b) ++a;
  while (b == forbid1 || b == forbid2 || used[b] || a == b) ++b;
  used[a] = true;
  used[b] = true;
}
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  n *= 2;
  long long minSum = 9999999;
  int a[100];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  sort(&a[0], &a[n]);
  for (int i = 0; i < n; ++i)
    for (int j = i + 1; j < n; ++j) {
      int tempSum = 0;
      for (int i = 0; i < 100; ++i) used[i] = 0;
      for (int g = 0, g1 = 1; g < n && g1 < n; ++g, ++g1) {
        solveProblem(g, g1, i, j);
        if (g >= n || g1 >= n) break;
        tempSum += abs(a[g] - a[g1]);
      }
      if (tempSum < minSum) minSum = tempSum;
    }
  cout << minSum << endl;
}
