#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 1e6 + 5;
long long int power(long long int base, long long int exp, long long int mod) {
  long long int res = 1;
  while (exp) {
    if (exp % 2) res *= base;
    base *= base;
    res %= mod;
    base %= mod;
    exp /= 2;
  }
  return res;
}
long long int n, arr[maxn], dp[maxn], val[maxn];
long long int go(long long int idx) {
  if (idx == n + 1) {
    return 0;
  }
  if (idx + 2 > n) {
    return 100ll * mod;
  }
  long long int &ret = dp[idx];
  if (ret != -1) {
    return ret;
  }
  ret = 100ll * mod;
  long long int save = 0;
  for (int i = idx + 2; i <= n && i <= idx + 5; i++) {
    long long int curr = go(i + 1) + arr[i] - arr[idx];
    if (curr < ret) {
      ret = curr;
      save = i;
    }
  }
  val[idx] = save;
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  memset(dp, -1, sizeof(dp));
  vector<pair<long long int, long long int> > v;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
    v.push_back({arr[i], i});
  }
  sort(arr + 1, arr + n + 1);
  sort(v.begin(), v.end());
  cout << go(1) << " ";
  int cnt = 0;
  memset(dp, 0, sizeof(dp));
  for (int i = 1; i <= n; i = val[i] + 1) {
    cnt++;
    assert(val[i] >= i + 2);
    for (int j = i; j <= val[i]; j++) {
      dp[v[j - 1].second] = cnt;
    }
  }
  cout << cnt << "\n";
  for (int i = 1; i <= n; i++) cout << dp[i] << " ";
  return 0;
}
