#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> v1, v2, v3;
  int n, i, j, mn = INT_MAX, mx = INT_MIN;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> j;
    mn = min(mn, j);
    mx = max(mx, j);
    v1.push_back(j);
  }
  for (i = 0; i < v1.size(); i++) v1[i] = v1[i] - mn;
  sort(v1.begin(), v1.end());
  int z = 0, o = 0, t = 0;
  for (i = 0; i < n; i++) {
    z += (v1[i] == 0);
    o += (v1[i] == 1);
    t += (v1[i] == 2);
  }
  if (mx - mn < 2) {
    cout << n << "\n";
    for (i = 0; i < n; i++) cout << v1[i] + mn << " ";
    return 0;
  }
  int u = o / 2;
  while (u--) {
    v2.push_back(0);
    v2.push_back(2);
  }
  if (o % 2) v2.push_back(1);
  u = z;
  while (u--) v2.push_back(0);
  u = t;
  while (u--) v2.push_back(2);
  u = min(z, t);
  while (o--) v3.push_back(1);
  while (u--) {
    v3.push_back(1);
    v3.push_back(1);
  }
  if (z > t) {
    u = z - t;
    while (u--) v3.push_back(0);
  } else {
    u = t - z;
    while (u--) v3.push_back(2);
  }
  sort(v2.begin(), v2.end());
  sort(v3.begin(), v3.end());
  int cnt1 = 0, cnt2 = 0;
  for (i = 0; i < n; i++) {
    cnt1 += (v1[i] == v2[i]);
    cnt2 += (v1[i] == v3[i]);
  }
  if (cnt1 < cnt2) {
    cout << cnt1 << endl;
    for (i = 0; i < n; i++) cout << v2[i] + mn << " ";
  } else {
    cout << cnt2 << endl;
    for (i = 0; i < n; i++) cout << v3[i] + mn << " ";
  }
  return 0;
}
