#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> x(n);
  int mn = INF, mx = -INF;
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
    sum += x[i];
    mn = min(mn, x[i]);
    mx = max(mx, x[i]);
  }
  if (mn + 1 >= mx) {
    cout << n << endl;
    for (int i = 0; i < n; i++) {
      cout << x[i] << " ";
    }
    return 0;
  }
  int mnc = 0, mxc = 0;
  for (int i = 0; i < n; i++) {
    if (x[i] == mn) {
      mnc++;
    }
    if (x[i] == mx) {
      mxc++;
    }
  }
  int ans = n, ansi = mnc, ansj = mxc, ansk = n - mnc - mxc;
  for (int i = 0; i <= n; i++) {
    long long remains = sum - ((long long)mn * i);
    int j = n - i;
    remains += j - (long long)mx * j;
    int k = remains;
    if (k >= 0 && k <= j) {
      int aans = min(mnc, i) + min(k, mxc) + min(n - mnc - mxc, n - i - k);
      if (aans < ans) {
        ans = aans;
        ansi = i;
        ansj = k;
        ansk = n - i - k;
      }
    }
  }
  cout << ans << endl;
  for (int i = 0; i < ansi; i++) {
    cout << mn << " ";
  }
  for (int i = 0; i < ansj; i++) {
    cout << mx << " ";
  }
  for (int i = 0; i < ansk; i++) {
    cout << mn + 1 << " ";
  }
  return 0;
}
