#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
pair<int, int> a[N];
int f[N], b[N], ans[N];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i].first);
    a[i].second = i;
  }
  sort(a + 1, a + 1 + n);
  int cnt = 1, min = 1e9;
  f[3] = a[3].first - a[1].first;
  for (int i = 4; i <= n; i++) {
    if (i >= 6 && min > f[i - 3] - a[i - 2].first) {
      min = f[i - 3] - a[i - 2].first;
      cnt = i - 2;
    }
    f[i] = f[i - 1] + a[i].first - a[i - 1].first;
    b[i] = b[i - 1];
    if (f[i] > min + a[i].first) {
      f[i] = min + a[i].first;
      b[i] = cnt;
    }
  }
  int pos = 1, k = b[n];
  for (int i = n; i >= 1; i--) {
    ans[a[i].second] = pos;
    if (i == k) pos++, k = b[i - 1];
  }
  printf("%d %d\n", f[n], pos);
  for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
  return 0;
}
