#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int n, anss[N];
pair<int, int> arr[N];
bool flag[N];
pair<long long, int> mem[N];
bool vis[N];
pair<long long, int> solve(int i) {
  if (i == n) return {0, 0};
  auto &ret = mem[i];
  if (vis[i]) return ret;
  vis[i] = 1;
  auto x = solve(i + 1);
  x.first += arr[i + 1].first - arr[i].first;
  ret = x;
  if (n - i >= 3) {
    long long s = 0;
    for (int j = i + 2; j <= i + 3; ++j) s += arr[j].first - arr[j - 1].first;
    auto xx = solve(i + 3);
    xx.first += s;
    xx.second += 1;
    ret = min(ret, xx);
  }
  return ret;
}
void build(int i) {
  if (i == n) return;
  if (n - i < 3) {
    build(i + 1);
    return;
  }
  auto a = solve(i + 1);
  a.first += arr[i + 1].first - arr[i].first;
  long long s = 0;
  for (int j = i + 2; j <= i + 3; ++j) s += arr[j].first - arr[j - 1].first;
  auto b = solve(i + 3);
  b.first += s;
  b.second += 1;
  if (a <= b)
    build(i + 1);
  else {
    flag[i + 1] = 1;
    build(i + 3);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &arr[i].first);
    arr[i].second = i;
  }
  sort(arr + 1, arr + n + 1);
  long long s = 0;
  for (int i = 2; i <= 3; ++i) s += arr[i].first - arr[i - 1].first;
  auto ans = solve(3);
  ans.first += s;
  ans.second += 1;
  printf("%lld %d\n", ans.first, ans.second);
  flag[1] = 1;
  build(3);
  int add = 0;
  for (int i = 1; i <= n; ++i) {
    add += flag[i];
    anss[arr[i].second] = add;
  }
  for (int i = 1; i <= n; ++i) printf("%d ", anss[i]);
  return 0;
}
