#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t, i, j, l, r, f, e, x, y, mid, z, w, d, c, b, q, n, m, h, a, k;
  long long int t1, t2, t3, ans = 0, tc;
  cin >> n;
  vector<pair<long long int, long long int>> v(n);
  for (i = 0; i < n; ++i) {
    cin >> v[i].first;
    v[i].second = i;
  }
  sort(v.begin(), v.end());
  long long int val[n + 1];
  for (i = 0; i < n + 1; ++i) val[i] = 1e18;
  long long int ts[n + 1];
  val[0] = 0;
  for (i = 1; i <= n; i++) {
    for (j = i + 2; j <= i + 4 && j <= n; ++j) {
      if (val[j] > val[i - 1] + v[j - 1].first - v[i - 1].first) {
        val[j] = val[i - 1] + v[j - 1].first - v[i - 1].first;
        ts[j] = j - i + 1;
      }
    }
  }
  ans = 0;
  i = n;
  long long int cnt = 1;
  vector<long long int> res(n);
  while (i > 0) {
    x = i;
    ans += val[i];
    for (j = 0; j < ts[x]; ++j) {
      res[v[i - 1].second] = cnt;
      i--;
    }
    cnt++;
  }
  cnt--;
  cout << val[n] << " " << cnt << endl;
  for (i = 0; i < n; ++i) cout << res[i] << " ";
  return 0;
}
