#include <bits/stdc++.h>
const int N = 2e5;
const int INF = 1e9;
struct Student {
  int a, team, idx;
};
int n, team;
Student arr[N + 5];
int dp[N + 5], last[N + 5];
bool cmpA(Student a, Student b) { return a.a < b.a; }
bool cmpIdx(Student a, Student b) { return a.idx < b.idx; }
void readInput() {
  std::ios_base::sync_with_stdio(false);
  std::cin >> n;
  for (int i = 1; i <= n; i++) {
    std::cin >> arr[i].a;
    arr[i].idx = i;
  }
}
void initDp() {
  for (int i = 1; i <= n; i++) {
    dp[i] = INF;
  }
  dp[0] = 0;
}
void fillDp() {
  std::sort(arr + 1, arr + 1 + n, cmpA);
  initDp();
  for (int i = 3; i <= n; i++) {
    for (int j = 3; j <= 5; j++) {
      if (i - j < 0) continue;
      if (arr[i].a - arr[i - j + 1].a + dp[i - j] < dp[i]) {
        last[i] = i - j + 1;
        dp[i] = arr[i].a - arr[i - j + 1].a + dp[i - j];
      }
    }
  }
}
void fillTeam() {
  for (int i = n; i >= 1; i = last[i] - 1) {
    ++team;
    for (int j = i; j >= last[i]; j--) {
      arr[j].team = team;
    }
  }
}
void printAnswer() {
  std::sort(arr + 1, arr + 1 + n, cmpIdx);
  std::cout << dp[n] << " " << team << "\n";
  for (int i = 1; i <= n; i++) {
    if (i > 1) std::cout << " ";
    std::cout << arr[i].team;
  }
  std::cout << "\n";
}
int main() {
  readInput();
  fillDp();
  fillTeam();
  printAnswer();
}
