#include <bits/stdc++.h>
using namespace std;
int a[1000];
int main() {
  int n;
  cin >> n;
  n *= 2;
  long long maxsum = 1000000000000;
  long long SUM;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      SUM = 0;
      int x;
      int y;
      x = 0;
      while ((x == i) || (x == j)) {
        x++;
      }
      y = x + 1;
      while ((y == i) || (y == j)) {
        y++;
      }
      while (y < n) {
        SUM += (a[y] - a[x]);
        x = y + 1;
        while ((x == i) || (x == j)) {
          x++;
        }
        y = x + 1;
        while ((y == i) || (y == j)) {
          y++;
        }
      }
      maxsum = min(maxsum, SUM);
    }
  }
  cout << maxsum;
  return 0;
}
