#include <bits/stdc++.h>
using namespace std;
long long int dp[200005];
long long int ans[200005];
long long int sol[200005];
int main() {
  std::ios::sync_with_stdio(false);
  long long int n;
  cin >> n;
  vector<pair<long long int, long long int>> v;
  for (long long int i = 0; i < n; i++) {
    long long int x;
    cin >> x;
    v.push_back(make_pair(x, i));
  }
  sort(v.begin(), v.end());
  for (long long int i = 1; i <= n; i++) {
    dp[i] = 1000000000000;
    ans[i] = -1;
  }
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 3; j <= 5 && i + j <= n; j++) {
      long long int x = v[i + j - 1].first - v[i].first;
      if (dp[i + j] > dp[i] + x) {
        dp[i + j] = dp[i] + x;
        ans[i + j] = i;
      }
    }
  }
  long long int curr = n;
  long long int cnt = 0;
  while (curr != 0) {
    for (long long int i = curr - 1; i >= ans[curr]; i--) {
      sol[v[i].second] = cnt;
    }
    cnt++;
    curr = ans[curr];
  }
  cout << dp[n] << " " << cnt << endl;
  for (long long int i = 0; i < n; i++) {
    cout << sol[i] + 1 << " ";
  }
}
