#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long n;
  cin >> n;
  pair<long long, long long> a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  long long dp[n + 1], par[n + 1];
  dp[0] = 0;
  for (long long i = 1; i <= n; i++) {
    dp[i] = INT_MAX;
  }
  sort(a, a + n);
  for (long long i = 0; i < n; i++) {
    for (long long j = 3; j <= 5; j++) {
      if (i + j - 1 < n) {
        if ((dp[i] + a[i + j - 1].first - a[i].first) < dp[i + j]) {
          dp[i + j] = dp[i] + a[i + j - 1].first - a[i].first;
          par[i + j] = i;
        }
      }
    }
  }
  long long curr = n;
  long long ans[n];
  long long i = 1;
  for (; curr > 0;) {
    long long x = par[curr];
    while (curr >= x + 1) {
      ans[a[curr - 1].second] = i;
      curr--;
    }
    i++;
  }
  cout << dp[n] << " " << i - 1 << "\n";
  for (long long i = 0; i < n; i++) {
    cout << ans[i] << " ";
  }
  cout << "\n";
}
