#include <bits/stdc++.h>
using namespace std;
const long long maxn = 100010;
const long long inf = 1e9 + 7;
long long n, a[maxn];
long long minv = inf;
long long sum[3];
int main() {
  scanf("%I64d", &n);
  for (long long i = 1; i <= n; i++) {
    scanf("%I64d", &a[i]);
    minv = min(minv, a[i]);
  }
  for (long long i = 1; i <= n; i++) a[i] -= minv;
  for (long long i = 1; i <= n; i++) sum[a[i]]++;
  sort(a + 1, a + n + 1);
  if (a[n] < 2) {
    printf("%I64d\n", n);
    for (long long i = 1; i <= n; i++) printf("%I64d ", a[i] + minv);
    return 0;
  } else {
    long long temp = min(sum[0], sum[2]);
    long long temp2 = sum[1] >> 1;
    if (temp > temp2) {
      sum[1] += (temp << 1);
      sum[0] -= temp;
      sum[2] -= temp;
    } else {
      temp = temp2;
      sum[1] -= (temp << 1);
      sum[0] += temp;
      sum[2] += temp;
    }
    printf("%I64d\n", n - (temp << 1));
    for (long long i = 0; i < 3; i++)
      for (long long j = 1; j <= sum[i]; j++) printf("%I64d ", i + minv);
  }
  return 0;
}
