#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 2005;
const int mod = 1e9 + 7;
pair<int, int> a[maxn];
int dp[maxn];
int ans[maxn];
int n, m;
signed main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i].first, a[i].second = i;
  sort(a + 1, a + 1 + n);
  for (int i = 1; i <= n; i++) {
    dp[i] = 0x3f3f3f3f;
    for (int j = 3; j <= min(i, 6); j++) {
      if (dp[i] > dp[i - j] + a[i].first - a[i - j + 1].first)
        dp[i] = dp[i - j] + a[i].first - a[i - j + 1].first;
    }
  }
  int cnt = 0;
  for (int i = n; i;) {
    for (int j = 3; j <= min(6, i); j++) {
      if (dp[i] == dp[i - j] + a[i].first - a[i - j + 1].first) {
        ++cnt;
        for (int k = 1; k <= j; k++) ans[a[i - k + 1].second] = cnt;
        i = i - j;
        break;
      }
    }
  }
  cout << dp[n] << " " << cnt << endl;
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
  cout << endl;
  return 0;
}
