#include <bits/stdc++.h>
using namespace std;
int N;
long long dp[200005];
int last[200005], nr[200005];
multiset<pair<long long, int> > S;
struct elem {
  int pos, ans, val;
};
elem v[200005];
bool cmp1(elem a, elem b) { return a.val < b.val; }
bool cmp2(elem a, elem b) { return a.pos < b.pos; }
int main() {
  cin >> N;
  for (int i = 1; i <= N; ++i) cin >> v[i].val, v[i].pos = i;
  sort(v + 1, v + N + 1, cmp1);
  S.insert({-v[1].val, 0});
  for (int i = 3; i <= N; ++i) {
    if (i >= 6) S.insert({dp[i - 3] - v[i - 2].val, i - 3});
    int pos = S.begin()->second;
    dp[i] = dp[pos] + v[i].val - v[pos + 1].val;
    nr[i] = nr[pos] + 1;
    last[i] = pos;
  }
  int pos = N, team = nr[N];
  while (pos) {
    for (int i = pos; i > last[pos]; --i) v[i].ans = team;
    --team;
    pos = last[pos];
  }
  sort(v + 1, v + N + 1, cmp2);
  cout << dp[N] << " " << nr[N] << '\n';
  for (int i = 1; i <= N; ++i) cout << v[i].ans << " ";
  return 0;
}
