#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("-O3")
void a() {
  long long num;
  cin >> num;
  long long money_num;
  long long money_cost;
  long long additive;
  long long sum;
  for (int i = 0; i < num; i++) {
    cin >> money_num >> additive >> money_cost >> sum;
    if (max(sum % money_cost, sum - money_cost * money_num) > additive)
      cout << "NO";
    else
      cout << "YES";
    cout << '\n';
  }
  return;
}
namespace B {
void move(int& start, int& finish, vector<int>& arr) {
  for (int i = finish; i > start; i--) swap(arr[i], arr[i - 1]);
  return;
}
}  // namespace B
void small_order(int start, int finish, vector<int>& arr) {
  if (finish - start > 1) {
    int pos = 0;
    int val = 1000000;
    for (int i = start; i < finish; i++) {
      if (arr[i] < val) {
        val = arr[i];
        pos = i;
      }
    }
    B::move(start, pos, arr);
    int next_step = max(pos, start + 1);
    small_order(next_step, finish, arr);
  }
  return;
}
void print(vector<int>& arr) {
  for (auto& i : arr) cout << i << ' ';
  cout << '\n';
  return;
}
void b() {
  int number_of_tests;
  cin >> number_of_tests;
  int num;
  vector<int> arr;
  for (int i = 0; i < number_of_tests; i++) {
    cin >> num;
    arr.resize(num);
    for (auto& i : arr) cin >> i;
    small_order(0, int(arr.size()), arr);
    print(arr);
  }
  return;
}
namespace C {
void move(int pos, int index, vector<int>& arr) {
  int cur_pos = pos;
  for (int i = 0; i < arr.size(); i++) {
    if (arr[i] == index) {
      swap(arr[cur_pos++], arr[i]);
    }
  }
  return;
}
}  // namespace C
void c() {
  int length;
  int num;
  int jump_dist;
  cin >> length >> num >> jump_dist;
  vector<int> platforms(num);
  for (auto& i : platforms) cin >> i;
  vector<int> river(length, 0);
  int pos = length - 1;
  for (int i = int(platforms.size() - 1); i >= 0; i--) {
    while (platforms[i]-- > 0) river[pos--] = i + 1;
  }
  int cur_num = 0;
  pos = -1;
  while (pos < length) {
    if (pos + jump_dist >= length) break;
    for (int dx = 1; dx <= jump_dist; dx++)
      if (pos + dx < river.size() && river[pos + dx] != 0) {
        pos += dx;
        dx = 0;
      }
    if (cur_num == num) {
      bool flag = false;
      for (int dx = 1; dx <= jump_dist; dx++)
        if (dx + pos >= length) {
          pos += dx;
          break;
        } else if (river[pos + dx] != 0) {
          flag = true;
          break;
        }
      if (!flag) break;
    } else if (pos + jump_dist < length) {
      C::move(pos + jump_dist, ++cur_num, river);
    }
  }
  if (pos + jump_dist >= length) {
    cout << "YES" << '\n';
    print(river);
  } else
    cout << "NO";
  return;
}
void d() {
  int num;
  cin >> num;
  long long swap_cnt;
  string buff;
  int pos = 0;
  for (int i = 0; i < num; i++) {
    cin >> swap_cnt >> swap_cnt >> buff;
    for (int k = pos; k < buff.size(); k++)
      if (buff[k] == '1') {
        pos = k;
        break;
      }
    for (int j = pos + 1; j < buff.size(); j++) {
      if (buff[j] == '0' && buff[j - 1] != '0') {
        if (j - pos <= swap_cnt) {
          swap(buff[pos], buff[j]);
          swap_cnt -= j - pos;
          for (int k = pos; k < buff.size(); k++) {
            if (buff[k] == '1') {
              pos = k;
              break;
            }
          }
        } else {
          swap(buff[j - swap_cnt], buff[j]);
          break;
        }
      }
    }
    cout << buff << '\n';
    pos = 0;
  }
  return;
}
void set_team(int start_id, int finish_id, int team_number,
              vector<pair<int, int>*>& myStuds) {
  for (int id = start_id; id <= finish_id; id++)
    myStuds[id]->second = team_number;
  return;
}
struct {
  bool operator()(pair<int, int>*& p1, pair<int, int>*& p2) {
    return p1->first < p2->first;
  }
} rule;
void e() {
  int num;
  cin >> num;
  vector<pair<int, int>> studs(num, make_pair(0, 0));
  vector<pair<int, int>*> myStuds(num);
  vector<pair<int, int>> dp(num + 1, make_pair(1e9, 0));
  for (int i = 0; i < studs.size(); i++) {
    cin >> studs[i].first;
    myStuds[i] = &studs[i];
  }
  sort(myStuds.begin(), myStuds.end(), rule);
  dp.front().first = 0;
  for (int i = 0; i < dp.size(); i++) {
    if (i >= 3 && dp[i].first > dp[i - 3].first + myStuds[i - 1]->first -
                                    myStuds[i - 3]->first) {
      dp[i].first =
          dp[i - 3].first + myStuds[i - 1]->first - myStuds[i - 3]->first;
      dp[i].second = 3;
    }
    if (i >= 4 && dp[i].first > dp[i - 4].first + myStuds[i - 1]->first -
                                    myStuds[i - 4]->first) {
      dp[i].first =
          dp[i - 4].first + myStuds[i - 1]->first - myStuds[i - 4]->first;
      dp[i].second = 4;
    }
    if (i >= 5 && dp[i].first > dp[i - 5].first + myStuds[i - 1]->first -
                                    myStuds[i - 5]->first) {
      dp[i].first =
          dp[i - 5].first + myStuds[i - 1]->first - myStuds[i - 5]->first;
      dp[i].second = 5;
    }
  }
  int team_num = 0;
  int id = dp.size() - 1;
  int cnt;
  while (id > 0) {
    cnt = dp[id].second;
    team_num++;
    for (int k = 1; k <= cnt; k++) myStuds[id - k]->second = team_num;
    id -= cnt;
  }
  cout << dp.back().first << ' ' << team_num << '\n';
  for (auto& i : studs) cout << i.second << ' ';
  return;
}
void f() { return; }
void problem() {
  string str;
  cin >> str;
  vector<int> dp;
  for (auto& i : str) {
    i -= '0';
    if (dp.size() < 3)
      dp.emplace_back(i);
    else {
      int pos = 1e9;
      for (int j = dp.size() - 3; j >= 0; j -= 3)
        if (dp[j] <= i)
          break;
        else
          pos = j;
      if (pos != 1e9)
        dp[pos] = i;
      else
        dp.emplace_back(i);
    }
  }
  cout << dp.size();
  return;
}
void test() {
  for (int j = 0; j < 1e6; j++) cout << 1;
  return;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  e();
  return 0;
}
