#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  vector<array<int, 2>> a(n + 2);
  for (int i = 1; i <= n; i++) {
    cin >> a[i][0];
    a[i][1] = i;
  }
  sort(a.begin() + 1, a.begin() + n + 1);
  const long long INF = 1e18;
  vector<long long> dp(n + 1);
  vector<int> prt(n + 1);
  prt[0] = -1;
  int best = 0;
  dp[1] = dp[2] = INF;
  for (int i = 3; i <= n; i++) {
    dp[i] = dp[best] + a[i][0] - a[best + 1][0];
    prt[i] = best;
    if (dp[i - 2] - a[i - 1][0] < dp[best] - a[best + 1][0]) best = i - 2;
  }
  vector<int> ans(n + 1);
  int cnt = 1;
  for (int i = n; i > 1;) {
    int p = prt[i];
    for (int j = i; j > p; j--) {
      ans[a[j][1]] = cnt;
    }
    cnt += 1;
    i = p;
  }
  cout << dp[n] << ' ' << cnt - 1 << '\n';
  for (int i = 1; i <= n; i++) {
    cout << ans[i] << " \n"[i == n];
  }
  return 0;
}
