#include <bits/stdc++.h>
using namespace std;
template <class T>
void DBGpair(T a, string s = "") {
  return;
}
template <class T>
void DBGvec(vector<T> &a) {}
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
char dir[] = {'R', 'L', 'D', 'U'};
const int MOD = 1e9 + 7;
const long long INF = 1e9;
void setIO(string filename) {
  if (fopen((filename + ".in").c_str(), "r")) {
    freopen((filename + ".in").c_str(), "r", stdin);
    freopen((filename + ".out").c_str(), "w", stdout);
  }
}
const int N = 2e5 + 10;
int n, dp[N], p[N], t[N];
pair<int, int> a[N];
void solve() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i].first, a[i].second = i;
  sort(a, a + n);
  for (int i = 1; i <= n; i++) dp[i] = INF, p[i] = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 3; j <= 5; j++) {
      int d = a[i + j - 1].first - a[i].first;
      if (dp[i + j] > dp[i] + d) dp[i + j] = dp[i] + d, p[i + j] = i;
    }
  }
  int cur = n, cnt = 0;
  while (cur != 0) {
    for (int i = cur - 1; i >= p[cur]; i--) t[a[i].second] = cnt;
    cnt++;
    cur = p[cur];
  }
  cout << dp[n] << " " << cnt << "\n";
  for (int i = 0; i < n; i++) {
    cout << (i ? " " : "") << t[i] + 1;
  }
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int t = 1;
  for (int i = 1; i <= t; i++) solve();
  return 0;
}
