#include <bits/stdc++.h>
using namespace std;
class grp {
 public:
  int64_t skill, idx, last, tno;
};
inline bool comp(const grp& g1, const grp& g2) { return g1.skill < g2.skill; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int64_t n;
  cin >> n;
  grp* arr = new grp[n + 1];
  int64_t* dp = new int64_t[n + 1];
  int64_t* ans = new int64_t[n + 1];
  for (int64_t i = 1; i <= n; i++) {
    cin >> arr[i].skill;
    arr[i].idx = i;
    arr[i].last = 0;
    dp[i] = 1e9 + 5;
  }
  sort(arr + 1, arr + 1 + n, comp);
  dp[3] = arr[3].skill - arr[1].skill;
  dp[4] = arr[4].skill - arr[1].skill;
  dp[5] = arr[5].skill - arr[1].skill;
  for (int64_t i = 3; i <= n; i++) {
    if (i + 3 <= n) {
      int64_t x = dp[i] + arr[i + 3].skill - arr[i + 1].skill;
      if (x < dp[i + 3]) {
        dp[i + 3] = x;
        arr[i + 3].last = i;
      }
    }
    if (i + 4 <= n) {
      int64_t x = dp[i] + arr[i + 4].skill - arr[i + 1].skill;
      if (x < dp[i + 4]) {
        dp[i + 4] = x;
        arr[i + 4].last = i;
      }
    }
    if (i + 5 <= n) {
      int64_t x = dp[i] + arr[i + 5].skill - arr[i + 1].skill;
      if (x < dp[i + 5]) {
        dp[i + 5] = x;
        arr[i + 5].last = i;
      }
    }
  }
  int64_t tno = 1;
  for (int64_t i = n; i >= 1;) {
    int64_t j = arr[i].last;
    while (i > j) {
      arr[i].tno = tno;
      i--;
    }
    tno++;
  }
  cout << dp[n] << " " << tno - 1 << endl;
  for (int64_t i = 1; i <= n; i++) {
    ans[arr[i].idx] = arr[i].tno;
  }
  for (int64_t i = 1; i <= n; i++) {
    cout << ans[i] << " ";
  }
  cout << endl;
  delete[] arr;
  delete[] dp;
  delete[] ans;
  return 0;
}
