#include <bits/stdc++.h>
using namespace std;
long long a[200002];
pair<long long, long long> p[200002];
long long pre[200002];
long long s[200002];
long long dp[200002];
long long ans[200002];
int main() {
  long long n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    p[i] = pair<long long, long long>(a[i], i);
  }
  sort(p, p + n, greater<pair<long long, long long> >());
  fill(dp, dp + n + 1, 100000000000000000);
  dp[0] = 0;
  s[0] = 0;
  for (int i = 3; i <= n; i++) {
    long long num = -1;
    for (int j = 3; j <= 5; j++) {
      if (j > i) continue;
      if (dp[i - j] + p[i - j].first - p[i - 1].first < dp[i]) {
        num = j;
        dp[i] = dp[i - j] + p[i - j].first - p[i - 1].first;
      }
    }
    pre[i] = num;
    s[i] = s[i - num] + 1;
  }
  cout << dp[n] << " " << s[n] << endl;
  long long l = 1;
  long long now = n;
  while (now > 0) {
    for (int i = pre[now]; i > 0; i--) {
      ans[p[now - i].second] = l;
    }
    l++;
    now -= pre[now];
  }
  for (int i = 0; i < n; i++) cout << ans[i] << " ";
  cout << endl;
}
