#include <bits/stdc++.h>
using namespace std;
void nikal_pehli_fursat_mai() {
  int n;
  cin >> n;
  vector<pair<long long, long long> > v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i].first;
    v[i].second = i;
  }
  sort(v.begin(), v.end());
  vector<long long> dp(n + 1, 1e18);
  dp[0] = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 3; j < 6; j++) {
      if (i + j <= n)
        dp[i + j] = min(dp[i + j], dp[i] + v[i + j - 1].first - v[i].first);
    }
  }
  vector<int> ans(n);
  int team = 1;
  for (int i = n; i >= 3;) {
    for (int j = 3; j < 6; j++) {
      if (i - j >= 0 and dp[i] == dp[i - j] + v[i - 1].first - v[i - j].first) {
        for (int k = i - j; k <= i - 1; k++) ans[v[k].second] = team;
        i -= j;
        team++;
        break;
      }
    }
  }
  cout << dp[n] << " " << team - 1 << "\n";
  for (auto it : ans) cout << it << " ";
  cout << "\n";
  ;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int tc = 1;
  while (tc--) {
    nikal_pehli_fursat_mai();
  }
}
