#include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
ostream &operator<<(ostream &os, const pair<A, B> &p) {
  return os << '(' << p.first << ", " << p.second << ')';
}
template <typename T_container, typename T = typename enable_if<
                                    !is_same<T_container, string>::value,
                                    typename T_container::value_type>::type>
ostream &operator<<(ostream &os, const T_container &v) {
  os << '{';
  string sep;
  for (const T &x : v) os << sep << x, sep = ", ";
  return os << '}';
}
void dbg_out() { cerr << endl; }
template <typename Head, typename... Tail>
void dbg_out(Head H, Tail... T) {
  cerr << ' ' << H;
  dbg_out(T...);
}
const long long mxn = 1e5;
const long long INF = 2e18;
const int32_t M = 1000000007;
const long double pie = acos(-1);
void solve_LOG() {
  long long n;
  cin >> n;
  long long a[n];
  long long s = 0;
  for (long long i = 0; i <= n - 1; i++) {
    cin >> a[i];
    s += a[i];
  }
  if (*max_element(a, a + n) - *min_element(a, a + n) < 2) {
    cout << n;
    cout << "\n";
    for (long long x : a) cout << x << " ";
    cout << "\n";
    return;
  }
  long long k = *min_element(a, a + n);
  long long x[2] = {};
  for (long long i = 0; i <= n - 1; i++) {
    if (a[i] == k) x[0]++;
    if (a[i] == k + 1) x[1]++;
  }
  long long c = 2 * x[0] + x[1];
  long long ans = INF;
  long long yy[3] = {};
  for (long long y2 = 0; y2 <= c; y2++) {
    if ((c - y2) % 2) continue;
    long long y1 = (c - y2) / 2;
    if (n - y1 - y2 < 0) continue;
    long long ss = 0;
    ss += y1 * k;
    ss += y2 * (k + 1);
    ss += (n - y1 - y2) * (k + 2);
    if (s != ss) continue;
    long long z = 0;
    z += min(y1, x[0]);
    z += min(y2, x[1]);
    z += min(n - y1 - y2, n - x[0] - x[1]);
    if (z < ans) {
      ans = z;
      yy[0] = y1;
      yy[1] = y2;
      yy[2] = n - y1 - y2;
    }
  }
  cout << ans;
  cout << "\n";
  for (long long i = 0; i <= 2; i++) {
    for (long long j = 1; j <= yy[i]; j++) {
      cout << k + i << " ";
    }
  }
  cout << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long _t = 1;
  for (long long i = 1; i <= _t; i++) {
    solve_LOG();
  }
  return 0;
}
