#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 10;
const long long inf = 1e18;
long long sum, a[maxn], dp[maxn][3];
long long ans[maxn];
struct node {
  long long x, id;
} b[maxn];
bool cmp(node xx, node yy) { return xx.x < yy.x; }
int main() {
  ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    b[i].x = a[i];
    b[i].id = i;
    sum += a[i];
  }
  sort(b + 1, b + 1 + n, cmp);
  sort(a + 1, a + 1 + n);
  if (n <= 5) {
    cout << (a[n] - a[1]) << " 1" << endl;
    for (int i = 1; i <= n; i++) cout << "1 ";
    cout << endl;
    return 0;
  }
  for (int i = 2; i <= 5; i++) {
    dp[i][0] = dp[i][1] = dp[i][2] = a[i] - a[1];
  }
  for (int i = 6; i <= n; i++) {
    dp[i][0] =
        min(dp[i - 3][0], min(dp[i - 3][1], dp[i - 3][2])) + (a[i] - a[i - 2]);
    if (i >= 7)
      dp[i][1] = min(dp[i - 4][0], min(dp[i - 4][1], dp[i - 4][2])) +
                 (a[i] - a[i - 3]);
    else
      dp[i][1] = dp[i][0];
    if (i >= 8)
      dp[i][2] = min(dp[i - 5][0], min(dp[i - 5][1], dp[i - 5][2])) +
                 (a[i] - a[i - 4]);
    else
      dp[i][2] = min(dp[i][1], dp[i][0]);
  }
  long long num = 0;
  for (int i = n; i >= 1;) {
    num++;
    long long mins = dp[i][0], x1 = 0;
    for (int j = 1; j < 3; j++) {
      if (mins > dp[i][j]) {
        mins = dp[i][j];
        x1 = j;
      }
    }
    if (i <= 5) {
      for (; i >= 1; i--) ans[b[i].id] = num;
    } else {
      for (int j = i; j > i - (x1 + 3) && j >= 1; j--) {
        ans[b[j].id] = num;
      }
      i -= (x1 + 3);
    }
  }
  cout << min(dp[n][0], min(dp[n][1], dp[n][2])) << " " << num << endl;
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
  cout << endl;
  return 0;
}
