#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 3;
long long a[maxn];
long long max(long long a, long long b) { return a > b ? a : b; }
long long min(long long a, long long b) { return a < b ? a : b; }
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%I64d", &a[i]);
  sort(a + 1, a + 1 + n);
  if (a[n] - a[1] <= 1) {
    printf("%d\n", n);
    for (int i = 1; i <= n; i++) printf("%I64d ", a[i]);
    return 0;
  }
  int u = 0, v = 0, mid = 0;
  for (int i = 1; i <= n; i++)
    if (a[i] == a[1])
      u++;
    else if (a[i] == a[n])
      v++;
    else
      mid++;
  int x = min(u, v);
  if (mid / 2 < x) {
    printf("%d\n", n - x * 2);
    for (int i = 1; i <= x; i++) printf("%I64d ", a[1] + 1);
    for (int i = x + 1; i <= n - x; i++) printf("%I64d ", a[i]);
    for (int i = n - x + 1; i <= n; i++) printf("%I64d ", a[1] + 1);
  } else {
    int cnt = 0;
    printf("%d\n", n - mid / 2 * 2);
    for (int i = 1; i <= n; i++)
      if (a[i] == a[1] + 1 && cnt < mid / 2) {
        cnt++;
        printf("%I64d %I64d ", a[1], a[n]);
        i++;
      } else
        printf("%I64d ", a[i]);
  }
  return 0;
}
