#include <bits/stdc++.h>
using namespace std;
int a[100001];
void read(int &x) {
  x = 0;
  int f = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = x * 10 + c - '0';
    c = getchar();
  }
  x *= f;
}
int main() {
  int n;
  read(n);
  for (int i = 1; i <= n; ++i) read(a[i]);
  sort(a + 1, a + n + 1);
  if (a[n] - a[1] <= 1) {
    printf("%d\n", n);
    for (int i = 1; i <= n; ++i) printf("%d ", a[i]);
    return 0;
  }
  int s1 = 0, s2 = 0, s3 = 0;
  for (int i = 1; i <= n; ++i) {
    if (a[i] == a[1])
      s1++;
    else if (a[i] == a[n])
      s3++;
    else
      s2++;
  }
  int t = min(s1, s3), k = s2 / 2;
  int m = a[1];
  if (t > k) {
    for (int i = 1; i <= t; ++i) a[i] = m + 1;
    for (int i = 1; i <= t; ++i) a[n - i + 1] = m + 1;
    printf("%d\n", n - t * 2);
    for (int i = 1; i <= n; ++i) printf("%d ", a[i]);
  } else {
    for (int i = 1; i <= k; ++i) a[s1 + i * 2 - 1] = m, a[s1 + i * 2] = m + 2;
    printf("%d\n", n - k * 2);
    for (int i = 1; i <= n; ++i) printf("%d ", a[i]);
  }
}
