#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5;
int n;
long long dp[maxn];
int idx[maxn];
pair<int, int> a[maxn];
int sel[maxn];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a + 1, a + n + 1);
  memset(dp, 0x3f, sizeof(dp));
  long long val = 0;
  dp[0] = 0;
  for (int i = 3; i <= n; i++) {
    if (i >= 6) dp[i] = dp[i - 3] + a[i].first - a[i - 2].first, sel[i] = i - 3;
    if (dp[val] + a[i].first - a[val + 1].first < dp[i]) {
      dp[i] = dp[val] + a[i].first - a[val + 1].first;
      sel[i] = val;
    }
    if (i >= 5) {
      if (dp[val] - a[val + 1].first > dp[i - 2] - a[i - 1].first) val = i - 2;
    }
  }
  int i = n;
  int cnt = 0;
  while (i) {
    int nex = sel[i];
    cnt++;
    for (int j = nex + 1; j <= i; j++) idx[a[j].second] = cnt;
    i = nex;
  }
  cout << dp[n] << ' ' << cnt << endl;
  for (int i = 1; i <= n; i++) cout << idx[i] << ' ';
  cout << endl;
  return 0;
}
