#include <bits/stdc++.h>
using namespace std;
const long long N = 200005;
long long n, dp[N], p[N], t[N];
pair<long long, long long> a[N];
int32_t main() {
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a, a + n);
  for (long long i = 0; i <= n; i++) {
    dp[i] = 1000000009;
    p[i] = -1;
  }
  dp[0] = 0;
  for (long long i = 0; i < n; i++) {
    if (i + 3 <= n) {
      if (dp[i + 3] > dp[i] + a[i + 2].first - a[i].first) {
        dp[i + 3] = dp[i] + a[i + 2].first - a[i].first;
        p[i + 3] = i;
      }
    }
    if (i + 4 <= n) {
      if (dp[i + 4] > dp[i] + a[i + 3].first - a[i].first) {
        dp[i + 4] = dp[i] + a[i + 3].first - a[i].first;
        p[i + 4] = i;
      }
    }
    if (i + 5 <= n) {
      if (dp[i + 5] > dp[i] + a[i + 4].first - a[i].first) {
        dp[i + 5] = dp[i] + a[i + 4].first - a[i].first;
        p[i + 5] = i;
      }
    }
  }
  long long curr = n;
  long long cnt = 0;
  while (curr != 0) {
    for (long long i = curr - 1; i >= p[curr]; i--) {
      t[a[i].second] = cnt;
    }
    cnt++;
    curr = p[curr];
  }
  cout << dp[n] << " " << cnt << endl;
  for (long long i = 0; i < n; i++) cout << t[i] + 1 << " ";
  cout << endl;
}
