#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
const double EPS = 1e-10;
const double PI = acos(-1);
const pair<long long, int> INF = pair<long long, int>((long long)1e16, -1);
class EYetAnotherDivisionIntoTeams {
 public:
  void solve(std::istream& in, std::ostream& out) {
    ios_base::sync_with_stdio(false);
    in.tie(nullptr), out.tie(nullptr);
    int N;
    in >> N;
    vector<pair<long long, int> > A(N);
    for (int i = (0); i < (N); ++i) {
      in >> A[i].first;
      A[i].second = i;
    }
    sort((A).begin(), (A).end());
    vector<pair<int, int> > dp(N + 1, INF);
    dp[0] = pair<long long, int>(0, -1);
    for (int i = (1); i < (N + 1); ++i) {
      for (int j = (3); j < (6); ++j) {
        if (i < j) continue;
        if (dp[i - j].first + A[i - 1].first - A[i - j].first < dp[i].first) {
          dp[i].first = dp[i - j].first + A[i - 1].first - A[i - j].first;
          dp[i].second = j;
        }
      }
    }
    vector<int> ans(N);
    int cur = 1, len = dp[N].second, idx = N - 1;
    while (len != -1) {
      for (int i = (0); i < (len); ++i) {
        ans[A[idx].second] = cur;
        idx--;
      }
      len = dp[idx + 1].second;
      cur++;
    }
    out << dp[N].first << ' ' << cur - 1 << '\n';
    for (auto e : ans) out << e << ' ';
    out << '\n';
  }
};
int main() {
  EYetAnotherDivisionIntoTeams solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}
