#include <bits/stdc++.h>
using namespace std;
int arr[12345];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  n <<= 1;
  for (int i = 1; i <= n; i++) cin >> arr[i];
  sort(arr + 1, arr + 1 + n);
  int ans = 123456789;
  for (int i = 1; i <= n; i++)
    for (int w = i + 1; w <= n; w++) {
      int sum = 0;
      for (int x = 1; x <= n; x++)
        if (x != i && x != w)
          for (int y = x + 1; y <= n; y++)
            if (y != i && y != w) {
              sum += arr[y] - arr[x];
              x = y;
              break;
            }
      ans = min(ans, sum);
    }
  cout << ans << endl;
  return 0;
}
