#include <bits/stdc++.h>
using namespace std;
long long int solve2(long long int num) {
  long long int cnt = 0;
  if (num % 2 == 0) {
    while (num % 2 == 0) {
      num /= 2;
      cnt++;
    }
  }
  return cnt;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  vector<pair<long long int, long long int> > v;
  for (long long int i = 0; i < n; ++i) {
    long long int a;
    cin >> a;
    v.push_back(make_pair(a, i));
  }
  sort(v.begin(), v.end());
  long long int dp[n + 10];
  long long int team[n + 10];
  long long int kd[n + 10];
  dp[0] = 0;
  for (long long int i = 1; i < n; ++i) {
    dp[i] = INT_MAX;
    kd[i] = -1;
  }
  for (long long int i = 0; i < n; ++i) {
    for (long long int j = 3; j <= 5 && i + j <= n; j++) {
      long long int diff = v[i + j - 1].first - v[i].first;
      if (dp[i + j] > dp[i] + diff) {
        dp[i + j] = diff + dp[i];
        kd[i + j] = i;
      }
    }
  }
  long long int pm = n;
  long long int cnt = 0;
  while (pm != 0) {
    for (long long int j = pm - 1; j >= kd[pm]; j--) {
      team[v[j].second] = cnt;
    }
    cnt++;
    pm = kd[pm];
  }
  cout << dp[n];
  cout << " ";
  cout << cnt;
  cout << '\n';
  for (long long int i = 0; i < n; ++i) {
    cout << team[i] + 1;
    cout << " ";
  }
  cout << '\n';
  return 0;
}
