#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x[100010];
  map<int, int> m;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", x + i);
    m[x[i]]++;
  }
  sort(x, x + n);
  if (x[n - 1] - x[0] < 2) {
    printf("%d\n", n);
    for (int i = 0; i < n; ++i) {
      printf("%d ", x[i]);
    }
    printf("\n");
    return 0;
  }
  int tmp1 = m[x[0] + 1], tmp2 = 2 * min(m[x[0]], m[x[n - 1]]);
  if (tmp1 & 1) --tmp1;
  if (tmp1 >= tmp2) {
    printf("%d\n", n - tmp1);
    for (int i = 0; i < n; ++i) {
      if (x[i] == x[0] + 1) {
        --x[i];
        ++x[i + 1];
        ++i;
        tmp1 -= 2;
      }
      if (tmp1 == 0) break;
    }
  } else {
    printf("%d\n", n - tmp2);
    for (int i = 0, j = n - 1; i < j; ++i, --j) {
      ++x[i];
      --x[j];
      tmp2 -= 2;
      if (tmp2 == 0) break;
    }
  }
  for (int i = 0; i < n; ++i) {
    printf("%d ", x[i]);
  }
  printf("\n");
  return 0;
}
