#include <bits/stdc++.h>
using namespace std;
const long long int hell = 1000000007;
const long long int maxn = 2e5 + 5;
long long int n, ans, cnt;
pair<long long int, long long int> a[maxn];
long long int dp[maxn], store[maxn];
long long int go(long long int idx) {
  if (idx > n) return 0;
  if (dp[idx] != -1) return dp[idx];
  long long int tmp = 2e18;
  long long int mn = min(a[idx].first, a[idx + 1].first);
  long long int mx = max(a[idx].first, a[idx + 1].first);
  for (long long int j = idx + 2; j <= min(n, idx + 10); j++) {
    mn = min(mn, a[j].first);
    mx = max(mx, a[j].first);
    tmp = min(tmp, mx - mn + go(j + 1));
  }
  return dp[idx] = tmp;
}
void path(long long int idx) {
  if (idx > n) return;
  long long int tmp = go(idx);
  long long int mn = min(a[idx].first, a[idx + 1].first);
  long long int mx = max(a[idx].first, a[idx + 1].first);
  for (long long int j = idx + 2; j <= min(n, idx + 10); j++) {
    mn = min(mn, a[j].first);
    mx = max(mx, a[j].first);
    if (mx - mn + go(j + 1) == tmp) {
      cnt++;
      for (long long int k = idx; k <= j; k++) {
        store[a[k].second] = cnt;
      }
      return path(j + 1);
    }
  }
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  memset(dp, -1, sizeof(dp));
  for (long long int i = 1; i <= n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a + 1, a + n + 1);
  long long int ans = go(1);
  path(1);
  cout << ans << ' ' << cnt << '\n';
  for (long long int i = 1; i <= n; i++) {
    cout << store[i] << ' ';
  }
}
