#include <bits/stdc++.h>
using namespace std;
long long int dp[200005], p[200005];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  long long int i, j, arr[n + 5];
  vector<pair<long long int, long long int> > v(n);
  for (i = 0; i < n; i++) {
    cin >> v[i].first;
    v[i].second = i;
    dp[i] = 1000000007;
    p[i] = -1;
  }
  dp[0] = 0;
  dp[n] = 1000000007;
  p[0] = 0;
  p[n] = -1;
  sort(v.begin(), v.end());
  for (i = 0; i < n; i++) {
    for (j = 3; j <= 5 && (i + j) <= n; j++) {
      long long int diff = v[i + j - 1].first - v[i].first;
      if (dp[i + j] > dp[i] + diff) {
        dp[i + j] = dp[i] + diff;
        p[i + j] = i;
      }
    }
  }
  long long int cnt = 0, cur = n;
  ;
  long long int ans[n + 5];
  while (cur != 0) {
    for (i = cur - 1; i >= p[cur]; i--) ans[v[i].second] = cnt;
    cnt++;
    cur = p[cur];
  }
  cout << dp[n] << " " << cnt << "\n";
  for (i = 0; i < n; i++) cout << ans[i] + 1 << " ";
  cout << "\n";
  return 0;
}
