#include <bits/stdc++.h>
#pragma GCC optimize("-O3")
#pragma GCC optimize("Ofast")
using namespace std;
const long long MOD = 1e9 + 7;
long long n, m, k, l, r;
long long q, y;
long long kla, klb, dp[1000001], ans[1000001], e[1000001];
long long a[1000001];
string s, d;
vector<pair<long long, long long> > v;
bool tt[1000001];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  v.push_back(make_pair(0, 0));
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    v.push_back(make_pair(a[i], i));
  }
  sort(v.begin(), v.end());
  dp[0] = 0;
  for (int i = 1; i <= n; i++) dp[i] = 1e18;
  for (int i = 0; i < n; i++)
    for (int j = 3; j < min(n - i + 1, 6ll); j++) {
      if (dp[i + j] > dp[i] + v[i + j].first - v[i + 1].first) {
        dp[i + j] = dp[i] + v[i + j].first - v[i + 1].first;
        e[i + j] = j;
      }
    }
  long long p = 0;
  tt[n] = 1;
  for (int i = n; i > 0; i--) {
    if (tt[i]) p++, tt[i - e[i]] = 1;
    ans[v[i].second] = p;
  }
  cout << dp[n] << " " << p << "\n";
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
  return 0;
}
