#include <bits/stdc++.h>
using namespace std;
long long n, a[500005], sum, tot, xx;
long long mi, ma;
long long b, c, d;
long long e[4];
long long ans, s1, s2, s3;
void read(long long &x) {
  x = 0;
  long long k = 1;
  char c = getchar();
  while ((c != '-') && (c < '0' || c > '9')) c = getchar();
  if (c == '-') k = -1, c = getchar();
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  x = x * k;
}
void write(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
void init() { freopen("c.in", "r", stdin); }
int main() {
  read(n);
  mi = 888888, ma = -mi;
  for (long long i = 1; i <= n; i++) {
    read(a[i]), sum += a[i];
    mi = min(mi, a[i]), ma = max(ma, a[i]);
  }
  if (mi == ma || mi + 1 == ma) {
    write(n), printf("\n");
    for (long long i = 1; i <= n; i++) write(a[i]), printf(" ");
    return 0;
  }
  for (long long i = 1; i <= n; i++) {
    if (a[i] == mi)
      e[1]++;
    else if (a[i] == ma)
      e[3]++;
    else
      e[2]++;
  }
  tot = sum - mi * n, ans = 2147483647;
  for (long long i = 0; i <= n; i++) {
    if (i > tot) continue;
    if ((tot - i) % 2 == 0) {
      long long j = (tot - i) / 2;
      if (i + j > n) continue;
      if (min(e[1], n - i - j) + min(e[2], i) + min(e[3], j) < ans) {
        ans = min(e[1], n - i - j) + min(e[2], i) + min(e[3], j);
        s1 = n - i - j, s2 = i, s3 = j;
      }
    }
  }
  write(ans), printf("\n");
  for (long long i = 1; i <= s1; i++) write(mi), printf(" ");
  for (long long i = 1; i <= s2; i++) write(mi + 1), printf(" ");
  for (long long i = 1; i <= s3; i++) write(mi + 2), printf(" ");
  return 0;
}
