#include <bits/stdc++.h>
using namespace std;
int64_t n, n1, n2, n3, a[100000], mmin = (int)1e9, xmin = mmin, num[3];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i], mmin = min(mmin, a[i]);
  for (int i = 0; i < n; i++) num[a[i] - mmin]++;
  for (int64_t i = 0; i <= n; i++) {
    int64_t i2 = num[2] ? num[2] - num[0] + i : 0;
    int64_t i1 = num[2] ? i1 = n - i - i2 : num[1] - num[0] + i;
    int64_t tmin = min(i1, num[1]) + min(i, num[0]) + min(i2, num[2]);
    if (tmin < xmin && i2 >= 0 && i2 <= n && i1 >= 0 && i1 <= n &&
        i + i1 + i2 == n)
      n1 = i, n2 = i1, n3 = i2, xmin = tmin;
  }
  cout << xmin << endl;
  for (int i = 0; i < n1; i++) cout << mmin << " ";
  for (int i = 0; i < n2; i++) cout << mmin + 1 << " ";
  for (int i = 0; i < n3; i++) cout << mmin + 2 << " ";
  return 0;
}
