#include <bits/stdc++.h>
using namespace std;
int n;
int mx = -1000000000, mn = 1000000000, md;
int a[100005];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) mx = max(mx, a[i]), mn = min(mn, a[i]);
  if (mx - mn < 2) {
    cout << n << endl;
    for (int i = 1; i <= n; i++) cout << a[i] << " ";
    cout << endl;
    return 0;
  } else {
    md = (mx + mn) / 2;
    int cntmx = 0, cntmn = 0, cntmd;
    for (int i = 1; i <= n; i++) {
      if (a[i] == mx) cntmx++;
      if (a[i] == mn) cntmn++;
    }
    cntmd = n - cntmx - cntmn;
    int x = min(cntmx, cntmn);
    int y = cntmd / 2;
    int oldmx = cntmx, oldmn = cntmn, oldmd = cntmd;
    if (x > y) {
      cntmx -= x;
      cntmn -= x;
      cntmd += x * 2;
    } else {
      cntmx += y;
      cntmn += y;
      cntmd -= y * 2;
    }
    cout << min(cntmx, oldmx) + min(cntmn, oldmn) + min(cntmd, oldmd) << endl;
    for (int i = 1; i <= cntmd; i++) cout << md << " ";
    for (int i = 1; i <= cntmx; i++) cout << mx << " ";
    for (int i = 1; i <= cntmn; i++) cout << mn << " ";
    cout << endl;
  }
}
