#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pt = complex<ld>;
constexpr ll inf = 0x3FFFFFFFFFFFFF;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  ll n;
  cin >> n;
  vector<pair<ll, ll>> in(n);
  for (ll i = 0; i < n; i++) {
    ll x;
    cin >> x;
    in[i] = {x, i};
  }
  in.push_back({-1, -1});
  sort(begin(in), end(in));
  vector<ll> cost(n + 1, inf);
  vector<ll> prev(n + 1, -1);
  pair<ll, ll> mi = {inf, inf};
  cost[0] = 0;
  for (ll i = 3; i <= n; i++) {
    mi = min(mi, {cost[i - 3] - in[i - 2].first, i - 3});
    cost[i] = mi.first + in[i].first;
    prev[i] = mi.second;
  }
  vector<ll> res(n, -1);
  ll team = 0;
  for (ll c = n; c > 0; c = prev[c], team++) {
    for (ll i = prev[c] + 1; i <= c; i++) {
      res[in[i].second] = team;
    }
  }
  cout << cost[n] << " " << team << endl;
  for (ll x : res) {
    cout << x + 1 << " ";
  }
  cout << endl;
}
