#include <bits/stdc++.h>
using namespace std;
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
const long long mod = 1e9 + 7;
const long long N = 3e5 + 5;
void vjudge() {
  if (fopen("input.txt", "r")) {
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
  }
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
void solve() {
  long long n;
  cin >> n;
  vector<pair<long long, long long> > a(n + 1);
  for (long long i = 1; i <= n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a.begin(), a.end());
  vector<long long> dp(n + 1), par(n + 1);
  dp[0] = 0;
  par[0] = -1;
  dp[1] = dp[2] = 1e9;
  for (long long i = 3; i <= n; i++) {
    dp[i] = 1e9;
    for (long long j = max(1LL, i - 4); j <= i - 2; j++)
      if (dp[j - 1] + a[i].first - a[j].first < dp[i]) {
        dp[i] = dp[j - 1] + a[i].first - a[j].first;
        par[i] = j;
      }
  }
  vector<long long> ans(n + 1);
  long long idx = n;
  long long ctr = 0;
  while (idx > 0) {
    ctr++;
    for (long long i = idx; i >= par[idx]; i--) ans[a[i].second] = ctr;
    idx = par[idx] - 1;
  }
  cout << dp[n] << ' ' << ctr << "\n";
  for (long long i = 1; i <= n; i++) cout << ans[i] << ' ';
}
int32_t main() {
  vjudge();
  long long t = 1;
  while (t--) solve();
}
