#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200000 + 5;
const long long INF = (long long)(1e16 + 7);
int n;
struct stu {
  long long val;
  int pos;
  int pre;
  int grp;
} a[MAXN];
long long dp[MAXN];
bool cmp(stu a, stu b) { return a.val < b.val; }
bool cmp_re(stu a, stu b) { return a.pos < b.pos; }
int revert(int p, int g) {
  if (p <= 0) return g;
  int c = revert(a[p].pre, g + 1);
  int t = p;
  while (t >= 0 && t > a[p].pre) {
    a[t].grp = g;
    t--;
  }
  return c;
}
int main() {
  cin >> n;
  a[0].pre = -1;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].val;
    a[i].pos = i;
    a[i].pre = -1;
    dp[i] = INF;
  }
  sort(a + 1, a + n + 1, cmp);
  for (int i = 1; i <= n; i++) {
    for (int j = 3; j <= 5; j++) {
      if (i - j < 0) continue;
      long long tmp = dp[i - j] + a[i].val - a[i - j + 1].val;
      if (dp[i] > tmp) {
        dp[i] = tmp;
        a[i].pre = i - j;
      }
    }
  }
  int cnt = revert(n, 1);
  sort(a + 1, a + n + 1, cmp_re);
  cout << dp[n] << " " << cnt - 1 << endl;
  for (int i = 1; i <= n; i++) {
    cout << a[i].grp << " ";
  }
  cout << endl;
  return 0;
}
