#include <bits/stdc++.h>
const int mx = 1e6 + 5;
const int inf = 0x3f3f3f3f;
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  scanf("%d", &n);
  vector<pair<int, int> > v(n);
  vector<int> dp(n + 10, 1e9 + 10), b(n + 10, -1), ans(n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &v[i].first);
    v[i].second = i;
  }
  dp[0] = 0;
  sort(v.begin(), v.end());
  for (int i = 0; i < n; ++i) {
    for (int j = 3; j <= 5; ++j) {
      if (i + j > n) break;
      int d = v[i + j - 1].first - v[i].first;
      if (dp[i + j] > dp[i] + d) {
        b[i + j] = i;
        dp[i + j] = dp[i] + d;
      }
    }
  }
  int t = 1, k = n;
  while (k != 0) {
    for (int i = k - 1; i >= b[k]; --i) ans[v[i].second] = t;
    ++t;
    k = b[k];
  }
  printf("%d %d\n", dp[n], t - 1);
  for (int i = 0; i < n; ++i) printf("%d ", ans[i]);
  puts("");
  return 0;
}
