#include <bits/stdc++.h>
using namespace std;
const int maxn = 200000 + 5;
int n;
struct Node {
  int x, i;
  Node(int x = -1, int i = -1) : x(x), i(i) {}
  bool operator<(const Node &node) const { return x < node.x; }
} nodes[maxn];
int a[maxn];
int d[maxn];
int cnt[maxn];
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> nodes[i].x;
    nodes[i].i = i;
  }
  sort(nodes + 1, nodes + n + 1);
  a[nodes[1].i] = 1;
  a[nodes[2].i] = 1;
  a[nodes[3].i] = 1;
  d[3] = nodes[3].x - nodes[1].x;
  cnt[3] = 3;
  for (int i = 4; i <= n; i++) {
    if (i < 6) {
      d[i] = nodes[i].x - nodes[1].x;
      a[nodes[i].i] = 1;
      cnt[i] = i;
    } else {
      if (i >= 6) {
        d[i] = d[i - 3] + nodes[i].x - nodes[i - 2].x;
        cnt[i] = 3;
      }
      if (i >= 7) {
        if (d[i] > d[i - 4] + nodes[i].x - nodes[i - 3].x) {
          d[i] = d[i - 4] + nodes[i].x - nodes[i - 3].x;
          cnt[i] = 4;
        }
      }
      if (i >= 8) {
        if (d[i] > d[i - 5] + nodes[i].x - nodes[i - 4].x) {
          d[i] = d[i - 5] + nodes[i].x - nodes[i - 4].x;
          cnt[i] = 5;
        }
      }
    }
  }
  int xxx = 1;
  for (int i = n; i >= 1; i--) {
    int tmp = 0;
    while (tmp < cnt[i]) {
      a[nodes[i - tmp].i] = xxx;
      tmp++;
    }
    i = i - cnt[i] + 1;
    xxx++;
  }
  cout << d[n] << " " << xxx - 1 << endl;
  for (int i = 1; i <= n; i++) {
    cout << a[i];
    if (i == n) {
      cout << endl;
    } else {
      cout << " ";
    }
  }
  return 0;
}
