#include <bits/stdc++.h>
using namespace std;
bool cmp(pair<long long, int> a, pair<long long, int> b) {
  return a.second < b.second;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<pair<long long, int> > st(n);
  for (int i = 0; i < n; i++) {
    cin >> st[i].first;
    st[i].second = i;
  }
  sort(st.begin(), st.end());
  st.push_back(st[n - 1]);
  vector<pair<long long, int> > dp(n, {0, -1});
  dp[2].first = st[3].first - st[2].first;
  priority_queue<pair<long long, int> > pq;
  for (int i = 3; i < n; i++) {
    pq.push({dp[i - 3].first, i - 3});
    long long w = st[i + 1].first - st[i].first;
    auto u = pq.top();
    dp[i] = make_pair(w + u.first, u.first != 0 ? u.second : -1);
  }
  long long res = st[n - 1].first - st[0].first - dp[n - 1].first;
  vector<int> cam;
  int u = dp[n - 1].second;
  while (u != -1) {
    cam.push_back(u);
    u = dp[u].second;
  }
  int k = cam.size() + 1;
  cout << res << ' ' << k << endl;
  sort(cam.begin(), cam.end());
  int time = 0;
  for (int i = 0; i < n; i++) {
    st[i].first = time + 1;
    if (time < k - 1 && cam[time] == i) time++;
  }
  st.resize(n);
  sort(st.begin(), st.end(), cmp);
  for (int i = 0; i < n; i++) {
    cout << st[i].first << ' ';
  }
  cout << endl;
}
