#include <bits/stdc++.h>
using namespace std;
int get(vector<int> a, vector<int> b) {
  int res = 0;
  for (int i = 0; i < a.size(); ++i) res += abs(a[i] - b[i]);
  return res;
}
int main() {
  int n;
  cin >> n;
  vector<int> x(n);
  for (int i = 0; i < n; ++i) cin >> x[i];
  int Min = x[0];
  for (int i = 1; i < n; ++i) Min = min(Min, x[i]);
  int Max = x[0];
  for (int i = 1; i < n; ++i) Max = max(Max, x[i]);
  vector<int> all(3, 0);
  for (int i = 0; i < n; ++i) ++all[x[i] - Min];
  if (Max - Min < 2) {
    cout << n << endl;
    for (int i = 0; i < 3; ++i) {
      for (int j = 0; j < all[i]; ++j) cout << Min + i << " ";
    }
    return 0;
  }
  vector<int> now(3, 0);
  now = all;
  while (now[1] > 1) {
    now[1] -= 2;
    ++now[0];
    ++now[2];
  }
  vector<int> res;
  int ans = 0;
  while (min(now[0], now[2]) >= 0) {
    if (get(all, now) >= ans) {
      ans = get(all, now);
      res = now;
    }
    --now[0];
    --now[2];
    now[1] += 2;
  }
  cout << min(res[0], all[0]) + min(res[1], all[1]) + min(res[2], all[2])
       << endl;
  for (int i = 0; i < 3; ++i) {
    for (int j = 0; j < res[i]; ++j) cout << Min + i << " ";
  }
  cout << endl;
}
