#include <bits/stdc++.h>
using namespace std;
long long n;
struct A {
  long long z;
  long long index;
} a[2000003];
long long f[2000003], js = 1, tot = 0;
long long wz[2000003], dk[2000003], mem[2000003];
long long comp(A a, A b) { return a.z < b.z; }
long long dp(long long n) {
  if (mem[n] != -233) return mem[n];
  if (n == 3) return a[3].z - a[1].z;
  if (n == 4) return a[4].z - a[1].z;
  if (n == 5) return a[5].z - a[1].z;
  long long ans[6];
  ans[3] = ans[4] = ans[5] = 0x0fffffffffffffff;
  if (n - 3 >= 3) ans[3] = dp(n - 3) - a[n - 3 + 1].z + a[n].z;
  if (n - 4 >= 3) ans[4] = dp(n - 4) - a[n - 4 + 1].z + a[n].z;
  if (n - 5 >= 3) ans[5] = dp(n - 5) - a[n - 5 + 1].z + a[n].z;
  long long k = 3;
  if (ans[4] < ans[3] && ans[4] < ans[5]) k = 4;
  if (ans[5] < ans[3] && ans[5] < ans[4]) k = 5;
  dk[n] = k;
  return mem[n] = ans[k];
}
long long minn(long long a, long long b, long long c) {
  if (a <= b && a <= c) return 3;
  if (b <= a && b <= c) return 4;
  if (c <= a && c <= b) return 5;
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].z;
    a[i].index = i;
    mem[i] = -233;
    f[i] = 0x0fffffffffffffff;
  }
  for (int i = 1; i <= 5; i++) dk[i] = i;
  sort(a, a + 1 + n, comp);
  f[3] = a[3].z - a[1].z;
  f[4] = a[4].z - a[1].z;
  f[5] = a[5].z - a[1].z;
  for (int i = 6; i <= n; i++) {
    if (i - 3 >= 3) f[i] = min(f[i], f[i - 3] + a[i].z - a[i - 3 + 1].z);
    if (i - 4 >= 3) f[i] = min(f[i], f[i - 4] + a[i].z - a[i - 4 + 1].z);
    if (i - 5 >= 3) f[i] = min(f[i], f[i - 5] + a[i].z - a[i - 5 + 1].z);
    dk[i] = minn(f[i - 3] + a[i].z - a[i - 3 + 1].z,
                 f[i - 4] + a[i].z - a[i - 4 + 1].z,
                 f[i - 5] + a[i].z - a[i - 5 + 1].z);
  }
  long long p = n;
  while (dk[p]) {
    for (int i = p - dk[p] + 1; i <= p; i++) wz[a[i].index] = js;
    js++;
    p = p - dk[p];
  }
  cout << f[n] << " " << js - 1 << endl;
  for (int i = 1; i <= n; i++) cout << wz[i] << " ";
  return 0;
}
