#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
long long n, mem[N], cur = 1, x[N];
pair<int, int> p[N];
long long solve(int idx) {
  if (idx == n) return 0;
  if (idx > n) return 2e9;
  if (mem[idx] != -1) return mem[idx];
  long long op1, op2, op3;
  op1 = p[idx + 2].first - p[idx].first + solve(idx + 3);
  op2 = p[idx + 3].first - p[idx].first + solve(idx + 4);
  op3 = p[idx + 4].first - p[idx].first + solve(idx + 5);
  return mem[idx] = min(op1, min(op2, op3));
}
void build(int idx) {
  if (idx == n) return;
  if (idx > n) return;
  long long op1, op2, op3;
  op1 = p[idx + 2].first - p[idx].first + solve(idx + 3);
  op2 = p[idx + 3].first - p[idx].first + solve(idx + 4);
  op3 = p[idx + 4].first - p[idx].first + solve(idx + 5);
  if (mem[idx] == op1) {
    x[p[idx].second] = cur;
    x[p[idx + 1].second] = cur;
    x[p[idx + 2].second] = cur;
    cur++;
    build(idx + 3);
    return;
  } else if (mem[idx] == op2) {
    x[p[idx].second] = cur;
    x[p[idx + 1].second] = cur;
    x[p[idx + 2].second] = cur;
    x[p[idx + 3].second] = cur;
    cur++;
    build(idx + 4);
    return;
  } else {
    x[p[idx].second] = cur;
    x[p[idx + 1].second] = cur;
    x[p[idx + 2].second] = cur;
    x[p[idx + 3].second] = cur;
    x[p[idx + 4].second] = cur;
    cur++;
    build(idx + 5);
    return;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> p[i].first;
    p[i].second = i;
  }
  sort(p, p + n);
  memset(mem, -1, sizeof mem);
  cout << solve(0) << " ";
  build(0);
  cout << cur - 1 << endl;
  for (int i = 0; i < n; i++) cout << x[i] << " ";
  return 0;
}
