#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(0);
  std::cin.tie(0);
  std::cout.tie(0);
  int n;
  cin >> n;
  vector<pair<long long, long long> > a(n);
  for (int i = 0; i < n; i++) cin >> a[i].first, a[i].second = i;
  sort(a.begin(), a.end());
  vector<int> teamSize(n, 3);
  vector<long long> dp(n, 0);
  long long INF = 1e18;
  dp[n - 3] = a[n - 1].first - a[n - 3].first;
  for (int i = n - 4; i >= 0; i--) {
    long long temp = ((i + 3 <= n - 3) ? a[i + 2].first + dp[i + 3] : INF);
    dp[i] = -a[i].first + min(a[i + 1].first + dp[i + 1], temp);
    if ((i + 3 <= n - 3) && (temp < a[i + 1].first + dp[i + 1])) {
      teamSize[i] = 3;
    } else
      teamSize[i] = teamSize[i + 1] + 1;
  }
  int cur = 0;
  int id = 1;
  while (cur < n) {
    int curSize = teamSize[cur];
    while (curSize--) {
      swap(a[cur].first, a[cur].second);
      a[cur++].second = id;
    }
    id++;
  }
  cout << dp[0] << " " << id - 1 << "\n";
  sort(a.begin(), a.end());
  for (auto it : a) cout << it.second << " ";
  cout << "\n";
}
