#include <bits/stdc++.h>
using namespace std;
int a[100010];
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int sum = 0;
  int n;
  cin >> n;
  cin >> a[0];
  int minv = a[0], maxv = a[0];
  sum = a[0];
  for (int i = 1; i < n; i++) {
    cin >> a[i];
    sum += a[i];
    minv = min(minv, a[i]);
    maxv = max(maxv, a[i]);
  }
  if (maxv - minv < 2) {
    cout << n << '\n';
    for (int i = 0; i < n; i++) {
      cout << a[i] << ' ';
    }
    cout << '\n';
  } else {
    int cminv = 0, cmidv = 0, cmaxv = 0;
    int vminv = 0, vmidv = n, vmaxv = 0;
    int midv = maxv - 1;
    long long balsum = 0;
    for (int i = 0; i < n; i++) {
      balsum += midv;
      if (a[i] == minv)
        cminv++;
      else if (a[i] == midv)
        cmidv++;
      else
        cmaxv++;
    }
    int ans = n, ansv = 0;
    long long int bal = sum - balsum;
    vmidv -= abs(bal);
    if (bal >= 0) {
      vmaxv += abs(bal);
    } else {
      vminv += abs(bal);
    }
    int i = 0;
    while (vmidv - 2 * i >= 0) {
      int val = min(cmidv, vmidv - 2 * i) + min(cminv, vminv + i) +
                min(cmaxv, vmaxv + i);
      if (val < ans) {
        ans = val;
        ansv = i;
      }
      i++;
    }
    cout << ans << '\n';
    for (int j = 0; j < vminv + ansv; j++) {
      cout << minv << ' ';
    }
    for (int j = 0; j < vmidv - 2 * ansv; j++) {
      cout << midv << ' ';
    }
    for (int j = 0; j < vmaxv + ansv; j++) {
      cout << maxv << ' ';
    }
    cout << '\n';
  }
  return 0;
}
