#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 30;
const int maxn = 100000 + 5;
int w[3];
int a[maxn];
int n, mn, sum;
int main() {
  scanf("%d", &n);
  mn = INF;
  sum = 0;
  memset(w, 0, sizeof(w));
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), mn = min(mn, a[i]);
  for (int i = 1; i <= n; i++) {
    a[i] = a[i] - (mn + 1);
    sum += a[i];
    w[a[i] + 1]++;
  }
  int ans = INF;
  int v1, v2, v3;
  for (int i = 0; i <= n; i++) {
    int tmp = sum + i;
    if (tmp < 0) continue;
    if (tmp > 0 && !w[2]) continue;
    if (n - tmp - i < 0) continue;
    if (n - tmp - i > 0 && !(w[1] || w[2])) continue;
    int tot = min(i, w[0]) + min(n - tmp - i, w[1]) + min(tmp, w[2]);
    if (tot < ans) {
      ans = tot;
      v1 = i;
      v2 = n - tmp - i;
      v3 = tmp;
    }
  }
  printf("%d\n", ans);
  for (int i = 1; i <= v1; i++) printf("%d ", mn);
  for (int i = 1; i <= v2; i++) printf("%d ", mn + 1);
  for (int i = 1; i <= v3; i++) printf("%d ", mn + 2);
  return 0;
}
