#include <bits/stdc++.h>
using namespace std;
const int maxn = 100003;
int n, a[maxn], mi, mx, buc[3], buc1[3];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  mi = mx = a[1];
  for (int i = 2; i <= n; i++) mi = min(mi, a[i]), mx = max(mx, a[i]);
  for (int i = 1; i <= n; i++) buc[a[i] - mi]++;
  memcpy(buc1, buc, sizeof(buc));
  int ans1 = n;
  while (buc[0] && buc[2]) {
    buc[0]--, buc[2]--, buc[1] += 2, ans1 -= 2;
  }
  int ans2 = n;
  if (mx - mi == 2) {
    while (buc1[1] >= 2) {
      buc1[0]++, buc1[2]++, buc1[1] -= 2, ans2 -= 2;
    }
  }
  if (ans1 > ans2) swap(ans1, ans2), swap(buc, buc1);
  printf("%d\n", ans1);
  for (int i = 1; i <= buc[0]; i++) printf("%d ", mi);
  for (int i = 1; i <= buc[1]; i++) printf("%d ", mi + 1);
  for (int i = 1; i <= buc[2]; i++) printf("%d ", mi + 2);
  return 0;
}
