#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
const double pi = acos(-1.0);
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int inf = 0x7f7f7f7f;
const int mod = 1e9 + 7;
const int N = 2e5 + 5;
int n, m;
double t;
int i, j, k;
long long dp[N];
long long a[N];
int id[N];
int ans[N];
bool cmp(int x, int y) { return a[x] < a[y]; }
int main() {
  while (~scanf("%d", &n)) {
    for (i = 1; i <= n; i++) scanf("%lld", &a[i]), id[i] = i;
    sort(id + 1, id + 1 + n, cmp);
    for (i = 1; i <= n; i++) {
      dp[i] = inf;
      for (k = 3; k <= min(5, i); k++) {
        dp[i] = min(dp[i], dp[i - k] + a[id[i]] - a[id[i - k + 1]]);
      }
    }
    int num = 0;
    for (i = n; i;) {
      for (k = 3; k <= min(5, i); k++) {
        if (dp[i] == dp[i - k] + a[id[i]] - a[id[i - k + 1]]) {
          num++;
          for (j = i - k + 1; j <= i; j++) ans[id[j]] = num;
          i -= k;
          break;
        }
      }
    }
    printf("%lld %d\n", dp[n], num);
    for (i = 1; i <= n; i++) printf("%d%c", ans[i], i == n ? '\n' : ' ');
  }
  return 0;
}
