#include <bits/stdc++.h>
using namespace std;
long long a[500003], n, m, d, ans, t, h[500003], k[500003], ma[500003],
    id[500003], trace[500003], g[500003];
bool cmp(int x, int y) { return a[x] < a[y]; }
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    id[i] = i;
    cin >> a[i];
  }
  sort(id + 1, id + 1 + n, cmp);
  sort(a + 1, a + 1 + n);
  h[3] = a[3] - a[1];
  trace[3] = 1;
  ma[1] = ma[2] = ma[3] = 1;
  k[1] = 1e9;
  for (int i = 4; i <= n; i++) {
    h[i] = a[i] - a[1];
    trace[i] = 1;
    if (h[i] > k[ma[i - 2]] + a[i]) {
      h[i] = k[ma[i - 2]] + a[i];
      trace[i] = ma[i - 2];
    }
    k[i] = h[i - 1] - a[i];
    ma[i] = i;
    if (k[ma[i]] > k[ma[i - 1]]) ma[i] = ma[i - 1];
  }
  int hh = n, cnt = 0;
  while (hh >= 1) {
    cnt++;
    for (int i = trace[hh]; i <= hh; i++) g[id[i]] = cnt;
    hh = trace[hh] - 1;
  }
  cout << h[n] << " " << cnt << endl;
  for (int i = 1; i <= n; i++) cout << g[i] << " ";
}
