#include <bits/stdc++.h>
using namespace std;
pair<int, int> P[200020];
int ans[200020], DP[200020][3];
int n, i, x, g;
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) cin >> P[i].first, P[i].second = i;
  sort(P + 1, P + n + 1);
  P[n + 1].first = P[n].first;
  DP[2][0] = DP[2][1] = DP[1][0] = DP[1][2] = -1000000000;
  for (i = 3; i <= n; i++) {
    DP[i][0] = P[i + 1].first - P[i].first + DP[i - 1][2];
    DP[i][1] = DP[i - 1][0];
    DP[i][2] = max(DP[i - 1][2], DP[i - 1][1]);
  }
  for (i = n; i >= 1; i--) {
    if (x == 1)
      x = 0;
    else if (x == 0) {
      g++;
      x = 2;
    } else if (DP[i - 1][1] > DP[i - 1][2])
      x = 1;
    ans[P[i].second] = g;
  }
  cout << P[n].first - P[1].first - DP[n][0] << " " << g << endl;
  for (i = 1; i <= n; i++) cout << ans[i] << " ";
  cout << endl;
}
