#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long n;
  cin >> n;
  vector<pair<long long, long long>> a(n);
  long long sum = 0;
  for (long long i = 0; i < n; i++) {
    cin >> a[i].first;
    sum += a[i].first;
    a[i].second = i;
  }
  sort(a.begin(), a.end());
  long long inf = 1e10;
  vector<long long> dp(n + 1, inf);
  vector<long long> parent(n + 1, -1);
  dp[0] = 0;
  for (long long i = 0; i <= n; i++) {
    long long pos1 = i + 3, pos2 = i + 4, pos3 = i + 5;
    if (pos1 <= n) {
      if (dp[pos1] > dp[i] + a[pos1 - 1].first - a[i].first) {
        dp[pos1] = dp[i] + a[pos1 - 1].first - a[i].first;
        parent[pos1] = i;
      }
    }
    if (pos2 <= n) {
      if (dp[pos2] > dp[i] + a[pos2 - 1].first - a[i].first) {
        dp[pos2] = dp[i] + a[pos2 - 1].first - a[i].first;
        parent[pos2] = i;
      }
    }
    if (pos3 <= n) {
      if (dp[pos3] > dp[i] + a[pos3 - 1].first - a[i].first) {
        dp[pos3] = dp[i] + a[pos3 - 1].first - a[i].first;
        parent[pos3] = i;
      }
    }
  }
  long long parent_no = 1;
  vector<long long> real_parent(n, -1);
  for (long long i = n; i >= 3;) {
    long long end = i - 1;
    long long p = parent[i];
    for (long long j = p; j <= end; j++) {
      long long idx = a[j].second;
      real_parent[idx] = parent_no;
    }
    i = p;
    parent_no++;
  }
  if (real_parent[a[0].second] == -1) parent_no++;
  for (long long i = 0; i < 3; i++) {
    long long idx = a[i].second;
    if (real_parent[idx] == -1) {
      real_parent[idx] = parent_no - 1;
    }
  }
  cout << dp[n] << " " << parent_no - 1 << "\n";
  for (long long i = 0; i < n; i++) {
    cout << real_parent[i] << " ";
  }
  cout << "\n";
  return 0;
}
