#include <bits/stdc++.h>
using namespace std;
long long INF = numeric_limits<long long>::max() / 2;
long long dp[200005][6];
pair<long long, long long> arr[200005];
long long f(int curr, int team) {
  long long& ret = dp[curr][team];
  if (~ret) return ret;
  if (curr == 0) return ret = 0;
  ret = INF;
  if (curr < team) return ret;
  long long score = arr[curr].first - arr[curr - team + 1].first;
  for (int i = 3; i <= 5; i++) {
    ret = min(ret, f(curr - team, i));
  }
  return ret += score;
}
int main() {
  memset(dp, -1, sizeof(dp));
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i].first;
    arr[i].second = i;
  }
  sort(arr + 1, arr + n + 1);
  long long mn = INF;
  for (int i = 3; i <= 5; i++) {
    mn = min(mn, f(n, i));
  }
  cout << mn << " ";
  int curr = n;
  int teamcounter = 1;
  while (curr >= 1) {
    for (int i = 3; i <= 5; i++) {
      if (f(curr, i) == mn) {
        mn -= (arr[curr].first - arr[curr - i + 1].first);
        for (int j = 0; j < i; j++) arr[curr - j].first = teamcounter;
        teamcounter++;
        curr -= i;
        break;
      }
    }
  }
  cout << teamcounter - 1 << '\n';
  for (int i = 1; i <= n; i++) swap(arr[i].first, arr[i].second);
  sort(arr + 1, arr + n + 1);
  for (int i = 1; i <= n; i++) cout << arr[i].second << " ";
}
