#include <bits/stdc++.h>
using namespace std;
int dis[200005];
int dp[200005] = {0};
int res[200005] = {0};
int path[200005] = {0};
int mk[200005] = {0};
struct node {
  int id, val;
  bool operator<(const node &b) const { return val < b.val; }
} a[200005];
int main() {
  int n, maxx = 0, minn = 1000000000;
  cin >> n;
  for (int i = 0; i < n; i++) {
    a[i].id = i;
    cin >> a[i].val;
    maxx = max(maxx, a[i].val);
    minn = min(minn, a[i].val);
  }
  sort(a, a + n);
  for (int i = 0; i < n - 1; i++) {
    dis[i] = a[i + 1].val - a[i].val;
  }
  if (n >= 6) {
    int pos = 2;
    dp[2] = dis[2];
    int ans = maxx - minn - dp[2];
    path[pos] = 0;
    mk[2] = 1;
    for (int i = 3; i < n - 3; i++) {
      if (dp[i - 3] + dis[i] > dp[i - 1]) {
        dp[i] = dp[i - 3] + dis[i];
        mk[i] = 1;
        path[i] = i - 3;
      } else {
        dp[i] = dp[i - 1];
        path[i] = i - 1;
      }
      if (maxx - minn - dp[i] < ans) {
        ans = maxx - minn - dp[i];
        pos = i;
      }
    }
    cout << ans;
    int color = 0;
    while (pos != 0) {
      if (mk[pos]) {
        color++;
        for (int i = pos + 1; i < n; i++) {
          int index = a[i].id;
          if (res[index] == 0)
            res[index] = color;
          else
            break;
        }
      }
      pos = path[pos];
    }
    cout << " " << color + 1 << endl;
    for (int i = 0; i < n; i++) {
      if (res[i] == 0) res[i] = color + 1;
      cout << res[i] << " ";
    }
  } else {
    cout << maxx - minn << " " << 1 << endl;
    for (int i = 0; i < n; i++) {
      cout << 1 << " ";
    }
  }
}
