#include <bits/stdc++.h>
using namespace std;
pair<long long, long long> a[200005];
long long dp[200005][2];
long long t[200005];
long long b[200005];
void find() {
  int n;
  cin >> n;
  int i;
  for (i = 1; i <= n; i++) cin >> a[i].first, a[i].second = i;
  a[n + 1].first = 0;
  sort(a + 1, a + 1 + n);
  dp[0][0] = -a[1].first, dp[0][1] = 0;
  dp[1][0] = -a[1].first, dp[1][1] = 0;
  dp[2][0] = -a[1].first, dp[2][1] = 0;
  for (i = 3; i <= n; i++) {
    dp[i][1] = i;
    int j = i - 3;
    dp[i][0] = dp[j][0] + a[i].first - a[i + 1].first;
    if (dp[i][0] > dp[i - 1][0] && i != n)
      dp[i][0] = dp[i - 1][0], dp[i][1] = dp[i - 1][1];
  }
  i = n;
  int k = 1;
  while (i > 0) {
    int j = max(i - 3, 0);
    for (i; i > dp[j][1]; i--) t[i] = k;
    k++;
    i = dp[j][1];
  }
  for (i = 1; i <= n; i++) b[a[i].second] = t[i];
  cout << dp[n][0] << " " << k - 1 << "\n";
  for (i = 1; i <= n; i++) cout << b[i] << " ";
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int t;
  t = 1;
  while (t--) {
    find();
  }
  return 0;
}
