#include <bits/stdc++.h>
using namespace std;
long long INF = 1e18;
struct custom_hash {
  static uint64_t splitmix64(uint64_t x) {
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }
  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM =
        chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};
template <class T>
void read(T arr[], long long n) {
  for (long long i = (0); i < (long long)(n); i++) cin >> arr[i];
}
long long mystoi(string str) {
  stringstream ss(str);
  long long ans = 0;
  ss >> ans;
  return ans;
}
long long exp(long long x, long long ex) {
  long long ans = 1ll;
  while (ex > 0) {
    if (ex & 1ll) ans = (ans * x) % 1000000007;
    ex >>= 1ll;
    x = (x * x) % 1000000007;
  }
  return ans;
}
long long nCrModp(long long n, long long r, long long p) {
  long long C[r + 1];
  memset(C, 0, sizeof(C));
  C[0] = 1;
  for (long long i = 1; i <= n; i++) {
    for (long long j = min(i, r); j > 0; j--) C[j] = (C[j] + C[j - 1]) % p;
  }
  return C[r];
}
bool isPrime(long long n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
bool sort_cond(const pair<long long, long long> &a,
               const pair<long long, long long> &b) {
  if (a.second >= 0 && b.second >= 0) {
    return a.first < b.first;
  } else {
    return (a.first + a.second) > (b.first + b.second);
  }
}
const long long MAXSIEVE = (1e3 + 5);
long long spf[MAXSIEVE];
void sieve() {
  spf[1] = 1;
  for (long long i = 2; i < MAXSIEVE; i++) spf[i] = i;
  for (long long i = 4; i < MAXSIEVE; i += 2) spf[i] = 2;
  for (long long i = 3; i * i < MAXSIEVE; i++) {
    if (spf[i] == i) {
      for (long long j = i * i; j < MAXSIEVE; j += i)
        if (spf[j] == j) spf[j] = i;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    long long n;
    cin >> n;
    vector<pair<long long, long long> > arr;
    for (long long i = (0); i < (long long)(n); i++) {
      long long a;
      cin >> a;
      arr.push_back({a, i});
    }
    sort(arr.begin(), arr.end());
    long long dp[(long long)2e5 + 50];
    long long p[(long long)2e5 + 50];
    for (int i = 1; i <= n; i++) {
      dp[i] = INF;
      p[i] = -1;
    }
    for (int i = 0; i < n; i++)
      for (int j = 3; j <= 5 && i + j <= n; j++) {
        int diff = arr[i + j - 1].first - arr[i].first;
        if (dp[i + j] > dp[i] + diff) {
          p[i + j] = i;
          dp[i + j] = dp[i] + diff;
        }
      }
    long long cur = n;
    long long cnt = 0;
    long long t[(long long)2e5 + 50];
    while (cur != 0) {
      for (int i = cur - 1; i >= p[cur]; i--) t[arr[i].second] = cnt;
      cnt++;
      cur = p[cur];
    }
    cout << dp[n] << " " << cnt << endl;
    for (long long i = (0); i < (long long)(n); i++) cout << t[i] + 1 << " ";
    cout << endl;
  }
}
