#include <bits/stdc++.h>
using namespace std;
void canhazfast() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
}
template <typename T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <typename T>
T extgcd(T a, T b, T &x, T &y) {
  T x0 = 1, y0 = 0, x1 = 0, y1 = 1;
  while (b) {
    T q = a / b;
    a %= b;
    swap(a, b);
    x0 -= q * x1;
    swap(x0, x1);
    y0 -= q * y1;
    swap(y0, y1);
  }
  x = x0;
  y = y0;
  return a;
}
int ctz(unsigned x) { return __builtin_ctz(x); }
int ctzll(unsigned long long x) { return __builtin_ctzll(x); }
int clz(unsigned x) { return __builtin_clz(x); }
int clzll(unsigned long long x) { return __builtin_clzll(x); }
int popcnt(unsigned x) { return __builtin_popcount(x); }
int popcntll(unsigned long long x) { return __builtin_popcountll(x); }
int bsr(unsigned x) { return 31 ^ clz(x); }
int bsrll(unsigned long long x) { return 63 ^ clzll(x); }
bool f[200016];
pair<int, int> a[200016];
int d[200016], t[200016];
int dp[200016], last[200016];
int main() {
  canhazfast();
  int n, k = 1, ans = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a, a + n);
  for (int i = 1; i < n; ++i) {
    d[i] = a[i].first - a[i - 1].first;
  }
  last[0] = last[1] = last[2] = -1;
  for (int i = 3; i <= n - 3; ++i) {
    dp[i] = dp[i - 1];
    last[i] = last[i - 1];
    int tmp = dp[i - 3] + d[i];
    if (dp[i] < tmp) {
      dp[i] = tmp;
      last[i] = i;
    }
  }
  ans = a[n - 1].first - a[0].first - dp[n - 3];
  for (int i = last[n - 3]; i >= 3; i = last[i - 3]) {
    f[i] = true;
  }
  for (int i = 0; i < n; ++i) {
    if (f[i]) ++k;
    t[a[i].second] = k;
  }
  cout << ans << ' ' << k << '\n';
  for (int i = 0; i < n; ++i) cout << t[i] << ' ';
  cout << '\n';
  return 0;
}
