#include <bits/stdc++.h>
using std::bitset;
using std::cin;
using std::cout;
using std::deque;
using std::endl;
using std::fill;
using std::lower_bound;
using std::pair;
using std::priority_queue;
using std::queue;
using std::set;
using std::sort;
using std::stack;
using std::string;
using std::upper_bound;
using std::vector;
const int maxn = (int)2e5 + 10;
struct node {
  int id;
  int val;
  bool operator<(const node& rhs) const { return val < rhs.val; }
};
node a[maxn];
int dif[maxn];
int dp[maxn];
int pre[maxn];
int group[maxn];
struct prcmp {
  bool operator()(const pair<int, int>& lhs, const pair<int, int>& rhs) const {
    return lhs.second < rhs.second;
  }
};
int main(int argc, char** argv) {
  if (argc == 2 && strcmp(argv[1], "-debug") == 0) {
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
  }
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    a[i].id = i;
    cin >> a[i].val;
  }
  sort(a, a + n);
  assert(n >= 3);
  if (n >= 6) {
    fill(dp, dp + n, -1);
    for (int i = 0; i < n - 1; i++) dif[i] = a[i + 1].val - a[i].val;
    dp[0] = dp[1] = 0;
    dp[2] = dif[2];
    dp[3] = dif[3];
    dp[4] = dif[4];
    fill(pre, pre + 4 + 1, -1);
    priority_queue<pair<int, int>, vector<pair<int, int>>, prcmp> q;
    for (int i = 5; i < n - 3; i++) {
      q.push({i - 3, dp[i - 3]});
      dp[i] = dif[i] + q.top().second;
      pre[i] = q.top().first;
    }
    int ansi = 0;
    for (int i = 0; i < n - 3; i++) {
      if (dp[i] >= dp[ansi]) ansi = i;
    }
    deque<int> lens;
    lens.push_front(n - 1 - ansi);
    int index = ansi;
    while (index != -1) {
      lens.push_front(index - pre[index]);
      index = pre[index];
    }
    int cnt = 0;
    {
      int i = 0;
      for (int len : lens) {
        ++cnt;
        for (int j = 0; j < len; j++) {
          group[a[i + j].id] = cnt;
        }
        i += len;
      }
    }
    printf("%d %d\n", a[n - 1].val - a[0].val - dp[ansi], cnt);
    for (int i = 0; i < n; i++) {
      printf("%d ", group[i]);
    }
    printf("\n");
  } else {
    cout << a[n - 1].val - a[0].val << " 1" << endl;
    for (int i = 0; i < n; i++) {
      printf("1 ");
    }
    printf("\n");
  }
  return 0;
}
