#include <bits/stdc++.h>
using namespace std;
const int N = 2e5;
const int INF = 1e9;
int n;
struct Item {
  int x, i;
} a[N + 1];
int dp[N + 1];
int opt[N + 1];
int ans[N];
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i].x;
    a[i].i = i;
  }
  sort(a, a + n, [](Item q, Item w) { return q.x < w.x; });
  for (int i = 1; i <= n; ++i) {
    dp[i] = INF;
    for (int j = i - 3; j >= max(0, i - 6); --j) {
      if (dp[i] > dp[j] + a[i - 1].x - a[j].x) {
        dp[i] = dp[j] + a[i - 1].x - a[j].x;
      }
    }
  }
  int k = 0;
  int s = n;
  while (s != 0) {
    for (int j = s - 3; j >= max(j, s - 6); --j) {
      if (dp[s] == dp[j] + a[s - 1].x - a[j].x) {
        while (--s != j) {
          ans[a[s].i] = k;
        }
        ans[a[s].i] = k;
        ++k;
        break;
      }
    }
  }
  cout << dp[n] << ' ' << k << '\n';
  for (int i = 0; i < n; ++i) {
    cout << ans[i] + 1 << ' ';
  }
  cout << '\n';
  return 0;
}
