#include <bits/stdc++.h>
using namespace std;
long long arr[100005];
long long total;
int n;
map<int, int> mp;
long long one, two;
long long mx = -100002, mn = 100002;
long long bin(long long n, int mk) {
  long long lo = 0, h = mk, ret = -1;
  while (lo <= h) {
    long long mid = (lo + h) / 2;
    long long mid2 = mk - mid;
    long long v = mid * mn + mid2 * mx;
    if (v == n) {
      one = mid;
      two = mid2;
      return min((long long)mp[mn], mid) + min((long long)mp[mx], mid2);
    } else if (v > n) {
      lo = mid + 1;
    } else {
      h = mid - 1;
    }
  }
  return ret;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", &arr[i]);
    total += arr[i];
    mp[arr[i]]++;
    mx = max(arr[i], mx);
    mn = min(arr[i], mn);
  }
  if (mx == mn || mx == mn + 1) {
    printf("%d\n", n);
    for (int i = 1; i <= n; i++) {
      cout << arr[i] << " ";
    }
    return 0;
  }
  long long md = mx - 1;
  long long mnn = n;
  one = mp[mn];
  two = mp[mx];
  long long mdmn = 0;
  for (long long i = 0; i <= n; i++) {
    long long d = bin(total - i * md, n - i);
    if (d != -1) {
      d += min((long long)mp[md], i);
      if (d < mnn) {
        mdmn = i;
        mnn = d;
      }
    }
  }
  bin(total - md * mdmn, n - mdmn);
  printf("%I64d\n", mnn);
  for (int i = 1; i <= one; i++) printf("%I64d ", mn);
  for (int i = 1; i <= mdmn; i++) printf("%I64d ", md);
  for (int i = 1; i <= two; i++) printf("%I64d ", mx);
}
