#include <bits/stdc++.h>
const long double eps = 0.00000001;
const long long MOD = 1e9 + 7;
using namespace std;
long long ans;
bool b;
string second;
int main() {
  fflush(stdin);
  cout << fixed, cout.precision(18);
  ios_base::sync_with_stdio(false);
  int i, j, n;
  cin >> n;
  int a[n];
  map<int, int> mm, mm1, mm2;
  set<int> se;
  for (i = 0; i < n; ++i) cin >> a[i], mm[a[i]]++, se.insert(a[i]);
  if (se.size() == 2) {
    int b1 = *se.begin();
    int b2 = b1 + 1;
    int b3 = *(--se.end());
    if (b3 - b1 == 1) {
      cout << n << endl;
      for (i = 0; i < n; ++i) cout << a[i] << " ";
    } else {
      int cnt = min(mm[b1], mm[b3]);
      mm1[b2] = mm[b2] + 2 * cnt;
      mm1[b1] = mm[b1] - cnt;
      mm1[b3] = mm[b3] - cnt;
      int ans =
          min(mm[b1], mm1[b1]) + min(mm[b2], mm1[b2]) + min(mm[b3], mm1[b3]);
      cout << ans << endl;
      for (i = 0; i < mm1[b1]; ++i) cout << b1 << " ";
      for (i = 0; i < mm1[b2]; ++i) cout << b2 << " ";
      for (i = 0; i < mm1[b3]; ++i) cout << b3 << " ";
    }
  } else if (se.size() == 1) {
    cout << n << endl;
    for (i = 0; i < n; ++i) cout << a[i] << " ";
  } else {
    int b1 = *se.begin();
    int b2 = *(++se.begin());
    int b3 = *(--se.end());
    int cnt = min(mm[b1], mm[b3]);
    mm1[b2] = mm[b2] + 2 * cnt;
    mm1[b1] = mm[b1] - cnt;
    mm1[b3] = mm[b3] - cnt;
    int ans1 =
        min(mm[b1], mm1[b1]) + min(mm[b2], mm1[b2]) + min(mm[b3], mm1[b3]);
    int ans2 = mm[b1] + mm[b3] + (mm[b2] % 2);
    mm2[b1] = mm[b1] + mm[b2] / 2;
    mm2[b3] = mm[b3] + mm[b2] / 2;
    mm2[b2] = (mm[b2] % 2);
    if (ans1 <= ans2) {
      cout << ans1 << endl;
      for (i = 0; i < mm1[b1]; ++i) cout << b1 << " ";
      for (i = 0; i < mm1[b2]; ++i) cout << b2 << " ";
      for (i = 0; i < mm1[b3]; ++i) cout << b3 << " ";
    } else {
      cout << ans2 << endl;
      for (i = 0; i < mm2[b1]; ++i) cout << b1 << " ";
      for (i = 0; i < mm2[b2]; ++i) cout << b2 << " ";
      for (i = 0; i < mm2[b3]; ++i) cout << b3 << " ";
    }
  }
}
