#include <bits/stdc++.h>
using namespace std;
const int maxn = 200005;
int n, a[maxn], cnt[maxn];
int main() {
  int i, x, y, n1, minn = maxn, maxx = -maxn;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    minn = min(minn, a[i]);
    maxx = max(maxx, a[i]);
  }
  sort(a + 1, a + n + 1);
  if (maxx - minn <= 1) {
    cout << n << "\n";
    for (i = 1; i <= n; i++) cout << a[i] << " ";
    return 0;
  }
  n1 = n;
  n = 1;
  cnt[1] = 1;
  for (i = 2; i <= n1; i++) {
    if (a[i] != a[n]) n++;
    a[n] = a[i];
    cnt[n]++;
  }
  if (n == 2) {
    cout << n1 - 2 * min(cnt[1], cnt[2]) << "\n";
    for (i = 1; i <= cnt[1] - min(cnt[1], cnt[2]); i++) cout << a[1] << " ";
    for (i = 1; i <= cnt[2] - min(cnt[1], cnt[2]); i++) cout << a[2] << " ";
    for (i = 1; i <= 2 * min(cnt[1], cnt[2]); i++)
      cout << (a[1] + a[2]) / 2 << " ";
  } else {
    x = (cnt[2] % 2 == 0) ? cnt[2] : cnt[2] - 1;
    y = 2 * min(cnt[1], cnt[3]);
    if (n1 - x <= n1 - y) {
      cout << n1 - x << "\n";
      for (i = 1; i <= cnt[1] + x / 2; i++) cout << a[1] << " ";
      for (i = 1; i <= cnt[3] + x / 2; i++) cout << a[3] << " ";
      for (i = 1; i <= cnt[2] - x; i++) cout << a[2] << " ";
    } else {
      cout << n1 - y << "\n";
      for (i = 1; i <= cnt[1] - min(cnt[1], cnt[3]); i++) cout << a[1] << " ";
      for (i = 1; i <= cnt[3] - min(cnt[1], cnt[3]); i++) cout << a[3] << " ";
      for (i = 1; i <= cnt[2] + 2 * min(cnt[1], cnt[3]); i++)
        cout << a[2] << " ";
    }
  }
  return 0;
}
