#include <bits/stdc++.h>
using namespace std;
int Add(int &a, int b) { a = (a + b) % 1000000007; }
int Min(int &a, int b) { a = (a + 1000000007 - b) % 1000000007; }
int Mul(int &a, int b) { a = (long long)a * b % 1000000007; }
long long gcd(long long a, long long b) {
  if (!b) return a;
  return gcd(b, a % b);
}
long long pow(long long a, long long b) {
  long long res(1);
  while (b) {
    if (b & 1) res = res * a % 1000000007;
    a = a * a % 1000000007;
    b >>= 1;
  }
  return res;
}
long long powM(long long a, long long b, long long mod) {
  long long res(1);
  while (b) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return res;
}
const int infi = 2147483647;
const long long infl = 9223372036854775807;
int n, m, k, T, a[100010];
int main() {
  scanf("%d", &n);
  int mi = 1e5 + 10, ma = -1e5 - 10;
  for (int i = 1; i <= (n); ++i)
    scanf("%d", &a[i]), mi = min(mi, a[i]), ma = max(ma, a[i]);
  if (mi != ma - 2) {
    printf("%d", (n)), putchar('\n');
    for (int i = 1; i <= (n); ++i)
      printf("%d", (a[i])), i < n ? putchar(' ') : putchar('\n');
  } else {
    int x = 0, y = 0, z = 0;
    for (int i = 1; i <= (n); ++i)
      if (a[i] == mi)
        x++;
      else if (a[i] == ma)
        z++;
      else
        y++;
    if (min(x, z) >= (y >> 1)) {
      printf("%d", (n - 2 * min(x, z))), putchar('\n');
      for (int i = 1; i <= (y + 2 * min(x, z)); ++i)
        printf("%d", (ma - 1)), putchar(' ');
      for (int i = 1; i <= (x - min(x, z)); ++i)
        printf("%d", (mi)), putchar(' ');
      for (int i = 1; i <= (z - min(x, z)); ++i)
        printf("%d", (ma)), putchar(' ');
    } else {
      printf("%d", (n - 2 * (y >> 1))), putchar('\n');
      for (int i = 1; i <= (y & 1); ++i) printf("%d", (ma - 1)), putchar(' ');
      for (int i = 1; i <= (x + (y >> 1)); ++i)
        printf("%d", (mi)), putchar(' ');
      for (int i = 1; i <= (z + (y >> 1)); ++i)
        printf("%d", (ma)), putchar(' ');
    }
  }
  return 0;
}
