#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int dx[] = {-1, 0, 1, 0, -1, -1, 1, 1};
const int dy[] = {0, 1, 0, -1, -1, 1, -1, 1};
const int N = 2e5 + 4;
long long dp[N];
int parent[N], col[N];
void solve(int test_case) {
  int n;
  cin >> n;
  vector<pair<int, int> > v(n + 1);
  for (int i = 0; i < n; i++) {
    int val;
    cin >> val;
    v[i + 1] = {val, i + 1};
  }
  sort((v).begin(), (v).end());
  memset(dp, 63, sizeof(dp));
  const long long inf = dp[0];
  dp[0] = 0;
  for (int i = 3; i <= n; i++) {
    int best_prev = -1;
    long long ans = inf;
    for (int del = 3; del <= 5; del++) {
      int prev = i - del;
      if (prev < 0) break;
      long long local = dp[prev] + v[i].first - v[prev + 1].first;
      if (local < ans) {
        ans = local;
        best_prev = prev;
      }
    }
    assert(best_prev != -1);
    parent[i] = best_prev;
    dp[i] = ans;
  }
  cout << dp[n] << " ";
  int node = n;
  int mex = 1;
  while (node) {
    int p = parent[node];
    for (int i = p + 1; i <= node; i++) {
      col[v[i].second] = mex;
    }
    mex++;
    node = p;
  }
  cout << mex - 1;
  cout << "\n";
  ;
  for (int i = 1; i <= n; i++) cout << col[i] << " ";
  cout << "\n";
  ;
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(0);
  int t = 1;
  for (int i = 1; i <= t; i++) {
    solve(i);
  }
  return 0;
}
