#include <bits/stdc++.h>
using namespace std;
long long arr[201234], dp[201234];
int ans[201234], path[201234], idx[201234];
bool cmp(int a, int b) { return arr[a] < arr[b]; }
int solve() {
  int n, team = 1;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
    idx[i] = i;
  }
  sort(idx + 1, idx + n + 1, cmp);
  dp[0] = 0;
  for (int i = 1; i <= n; i++) {
    dp[i] = 1e18;
    for (int j = 3; j <= min(5, i); j++) {
      long long curr = dp[i - j] + arr[idx[i]] - arr[idx[i - j + 1]];
      if (dp[i] > curr) {
        path[i] = i - j;
        dp[i] = curr;
      }
    }
  }
  for (int i = n; i > 0; i = path[i]) {
    for (int j = i; j > path[i]; j--) ans[idx[j]] = team;
    team++;
  }
  cout << dp[n] << " " << team - 1 << endl;
  for (int i = 1; i <= n; i++) {
    if (i > 1) cout << " ";
    cout << ans[i];
  }
  cout << endl;
  return 0;
}
void fun() {
  int t = 1;
  while (t--) solve();
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  fun();
  return 0;
}
