#include <bits/stdc++.h>
using namespace std;
template <typename T>
T gcd(T a, T b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long isPowerof2(long long x) { return (x && !(x & x - 1)); }
struct node {
  long long first;
  long long idx;
  long long ans;
};
bool cmp(node a, node b) { return a.first < b.first; }
bool cmp2(node a, node b) { return a.idx < b.idx; }
long long n;
node v[(long long)2e5 + 5];
long long dp[(long long)2e5 + 5];
long long ctr = 1;
long long fun(long long index, long long flag) {
  if (dp[index] != -1 && flag == 0) return dp[index];
  if ((n - index) <= 5) {
    if (flag == 0) return dp[index] = (v[n - 1].first - v[index].first);
    for (long long i = index; i < n; i++) {
      v[i].ans = ctr;
    }
    ctr++;
    return dp[index] = (v[n - 1].first - v[index].first);
  }
  long long x, y, z;
  x = y = z = 1e18;
  if ((n - (index + 3)) >= 3)
    x = v[index + 2].first - v[index].first + fun(index + 3, 0);
  if ((n - (index + 4)) >= 3)
    y = v[index + 3].first - v[index].first + fun(index + 4, 0);
  if ((n - (index + 5)) >= 3)
    z = v[index + 4].first - v[index].first + fun(index + 5, 0);
  if (flag == 1) {
    if (x <= y && x <= z) {
      for (long long(i) = (0); i < (3); i++) {
        v[index + i].ans = ctr;
      }
      ctr++;
      long long dump = fun(index + 3, 1);
    } else if (y <= x && y <= z) {
      for (long long(i) = (0); i < (4); i++) {
        v[index + i].ans = ctr;
      }
      ctr++;
      long long dump = fun(index + 4, 1);
    } else {
      for (long long(i) = (0); i < (5); i++) {
        v[index + i].ans = ctr;
      }
      ctr++;
      long long dump = fun(index + 5, 1);
    }
  }
  return dp[index] = min(min(x, y), z);
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  long long a[n];
  for (long long(i) = (0); i < (n); i++) {
    cin >> a[i];
    v[i].first = a[i];
    v[i].idx = i;
    v[i].ans = 0;
  }
  sort(v, v + n, cmp);
  for (long long(i) = (0); i < (n); i++) {
    dp[i] = -1;
  }
  long long res = fun(0, 1);
  cout << res << " " << ctr - 1 << '\n';
  sort(v, v + n, cmp2);
  for (long long(i) = (0); i < (n); i++) {
    if (v[i].ans > 0) {
      cout << v[i].ans << " ";
    } else {
      cout << ctr << " ";
    }
  }
  return 0;
}
