#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  vector<pair<int, int>> a(n);
  vector<int> diff(n), dp(n + 1), take(n + 1);
  for (int i = 0; i < n; i++) scanf("%d", &a[i].first), a[i].second = i;
  sort(a.begin(), a.end());
  if (n < 6) {
    cout << a[n - 1].first - a[0].first << ' ' << 1 << endl;
    for (int i = 0; i < n; i++) cout << 1 << ' ';
    return 0;
  }
  for (int i = 0; i < n - 1; i++) diff[i] = a[i + 1].first - a[i].first;
  dp[2] = diff[2];
  take[2] = 1;
  for (int i = 3; i < n - 3; i++) {
    if (dp[i - 3] + diff[i] > dp[i - 1]) {
      take[i] = 1;
      dp[i] = dp[i - 3] + diff[i];
    } else {
      dp[i] = dp[i - 1];
    }
  }
  vector<int> ans(n);
  int cnt = 1;
  for (int i = n - 1; i >= 0;) {
    if (take[i]) {
      ++cnt;
      for (int j = 0; j < 3; j++) ans[a[i--].second] = cnt;
    } else
      ans[a[i--].second] = cnt;
  }
  cout << a[n - 1].first - a[0].first - dp[n - 4] << ' ' << cnt << endl;
  for (int i = 0; i < n; i++) cout << ans[i] << ' ';
  return 0;
}
