#include <bits/stdc++.h>
using namespace std;
bool Cmp(pair<long long, long long> a, pair<long long, long long> b) {
  if (a.second > b.second) {
    return 0;
  }
  return 1;
}
int main() {
  long long n;
  cin >> n;
  vector<pair<long long, long long> > v(n);
  vector<pair<long long, long long> > p(n + 1, make_pair(1e9, 1e9));
  p[0].first = 0;
  for (long long i = 0; i < n; i++) {
    cin >> v[i].first;
    v[i].second = i;
  }
  sort(v.begin(), v.end());
  for (long long i = 3; i < n + 1; i++) {
    if (i - 3 >= 0 &&
        p[i - 3].first + v[i - 1].first - v[i - 3].first < p[i].first) {
      p[i].first = p[i - 3].first + v[i - 1].first - v[i - 3].first;
      p[i].second = 3;
    }
    if (i - 4 >= 0 &&
        p[i - 4].first + v[i - 1].first - v[i - 4].first < p[i].first) {
      p[i].first = p[i - 4].first + v[i - 1].first - v[i - 4].first;
      p[i].second = 4;
    }
    if (i - 5 >= 0 &&
        p[i - 5].first + v[i - 1].first - v[i - 5].first < p[i].first) {
      p[i].first = p[i - 5].first + v[i - 1].first - v[i - 5].first;
      p[i].second = 5;
    }
  }
  long long j = p.size() - 1, k = 1;
  while (j) {
    for (long long i = j; i > j - p[j].second; i--) {
      v[i - 1].first = k;
    }
    j -= p[j].second;
    k++;
  }
  sort(v.begin(), v.end(), Cmp);
  cout << p[n].first << ' ' << k - 1 << "\n";
  for (long long i = 0; i < v.size(); i++) {
    cout << v[i].first << ' ';
  }
  return 0;
}
