#include <bits/stdc++.h>
using namespace std;
int parent[200005 + 2], ans[200005 + 2];
long long dp[200005 + 2];
pair<int, int> a[200005];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) parent[i] = -1, dp[i] = 2000000000;
  for (int i = 0; i < n; i++) scanf("%d", &a[i].first), a[i].second = i;
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    for (int j = 3; j <= 5 && (i + j) <= n; j++) {
      int tem_val = a[i + j - 1].first - a[i].first;
      if (dp[i + j] > dp[i] + tem_val) {
        dp[i + j] = dp[i] + tem_val;
        parent[i + j] = i;
      }
    }
  }
  int cur = n;
  int team = 0;
  while (cur != 0) {
    for (int i = cur - 1; i >= parent[cur]; i--) {
      ans[a[i].second] = team + 1;
    }
    team++;
    cur = parent[cur];
  }
  printf("%lld %d\n", dp[n], team);
  for (int i = 0; i < n; i++) printf("%d ", ans[i]);
  puts("\n");
  return 0;
}
