#include <bits/stdc++.h>
using namespace std;
struct dian {
  int w, id;
} z[200005];
bool cmp(dian x, dian y) { return x.w < y.w; }
int n, be[200005], last, mini, pre[200005], f[200005], ans[200005];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &z[i].w);
    z[i].id = i;
  }
  int l = 0, r = 1000000000, mid;
  sort(z + 1, z + n + 1, cmp);
  f[1] = f[2] = 998244353;
  for (int i = 3; i <= n; i++) {
    if (f[i - 3] - z[i - 2].w < mini) {
      last = i - 3;
      mini = f[i - 3] - z[i - 2].w;
    }
    f[i] = mini + z[i].w;
    pre[i] = last;
  }
  int x = n;
  while (x) {
    be[pre[x] + 1]++;
    x = pre[x];
  }
  for (int i = 2; i <= n; i++) be[i] += be[i - 1];
  cout << f[n] << " " << be[n] << endl;
  for (int i = 1; i <= n; i++) ans[z[i].id] = be[i];
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
  return 0;
}
