#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int X = 0, w = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') w = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') X = X * 10 + c - '0', c = getchar();
  return X * w;
}
const int N = 200000 + 10;
int n, k = 0;
struct student {
  int w, id;
} a[N];
bool operator<(student a, student b) { return a.w < b.w; }
int dp[N], pre[N], ans[N];
inline void print(int n) {
  ++k;
  for (register int i = pre[n] + 1; i <= n; ++i) ans[a[i].id] = k;
  if (n) print(pre[n]);
}
int main() {
  n = read();
  for (register int i = 1; i <= n; ++i) a[i] = (student){read(), i};
  sort(a + 1, a + n + 1);
  memset(dp, 0x3f, sizeof(dp)), dp[0] = 0;
  for (register int i = 1; i <= n; ++i) {
    if (i >= 3 && dp[i - 3] + a[i].w - a[i - 2].w < dp[i])
      dp[i] = dp[i - 3] + a[i].w - a[i - 2].w, pre[i] = i - 3;
    if (i >= 4 && dp[i - 4] + a[i].w - a[i - 3].w < dp[i])
      dp[i] = dp[i - 4] + a[i].w - a[i - 3].w, pre[i] = i - 4;
    if (i >= 5 && dp[i - 5] + a[i].w - a[i - 4].w < dp[i])
      dp[i] = dp[i - 5] + a[i].w - a[i - 4].w, pre[i] = i - 5;
  }
  print(n), --k;
  printf("%d %d\n", dp[n], k);
  for (register int i = 1; i <= n; ++i) printf("%d%c", ans[i], " \n"[i == n]);
  return 0;
}
