#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int a[N], b[N], c[N], n, m;
int nxt[N], nxt1[N], nxt2[N], nx, nx1, nx2;
void ins(int x, int i) {
  if (x == 1) nxt[++nx] = i;
  if (x == 0) nxt1[++nx1] = i;
  if (x == 2) nxt2[++nx2] = i;
}
int main() {
  scanf("%d", &n);
  int mx = -(1 << 30), mn = 1 << 30;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    mx = max(mx, a[i]);
    mn = min(mn, a[i]);
  }
  if (mx - mn != 2) {
    printf("%d\n", n);
    for (int i = 1; i <= n; i++) printf("%d ", a[i]);
    return 0;
  }
  memcpy(b, a, sizeof(b));
  memcpy(c, a, sizeof(c));
  for (int i = 1; i <= n; i++) {
    if (a[i] == mx) ins(1, i);
    if (a[i] == mn) ins(0, i);
    if (a[i] != mx && a[i] != mn) ins(2, i);
  }
  int ans = n;
  for (int i = 1; i <= min(nx, nx1); i++) {
    b[nxt[i]]--;
    b[nxt1[i]]++;
    ans -= 2;
  }
  int an = n;
  for (int i = 1; i <= nx2 - 1; i += 2) {
    c[nxt2[i]]--;
    c[nxt2[i + 1]]++;
    an -= 2;
  }
  if (an < ans) {
    ans = an;
    memcpy(b, c, sizeof(b));
  }
  printf("%d\n", ans);
  for (int i = 1; i <= n; i++) printf("%d ", b[i]);
  return 0;
}
