#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 10;
int a[MAX];
map<int, int> st;
int ba, be, bi, bans;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", a + i);
    st[a[i]]++;
  }
  int mi, me, ma;
  int ci, ce, ca;
  vector<int> v;
  for (auto s : st) v.push_back(s.first);
  if (st.size() == 1) {
    printf("%d\n", n);
    for (int i = 0; i < n; ++i) printf("%d ", a[i]);
  } else if (st.size() == 2) {
    if (v[0] == v[1] - 1) {
      printf("%d\n", n);
      for (int i = 0; i < n; ++i) printf("%d ", a[i]);
    } else {
      int k = min(st[v[0]], st[v[1]]);
      printf("%d\n", n - k * 2);
      for (int i = 0; i < st[v[0]] - k; ++i) printf("%d ", v[0]);
      for (int i = 0; i < st[v[1]] - k; ++i) printf("%d ", v[1]);
      for (int i = 0; i < k * 2; ++i) printf("%d ", v[0] + 1);
    }
  } else {
    mi = v[0];
    me = v[1];
    ma = v[2];
    ci = st[mi];
    ca = st[ma];
    ce = st[me];
    bans = n;
    int op1 = (st[me]) / 2;
    int op2 = min(st[ma], st[mi]);
    if (op1 > op2) {
      ci += op1;
      ca += op1;
      ce -= 2 * op1;
    } else {
      ci -= op2;
      ca -= op2;
      ce += 2 * op2;
    }
    printf("%d\n", min(st[v[0]], ci) + min(st[v[1]], ce) + min(st[v[2]], ca));
    for (int i = 0; i < ci; ++i) printf("%d ", mi);
    for (int i = 0; i < ce; ++i) printf("%d ", me);
    for (int i = 0; i < ca; ++i) printf("%d ", ma);
  }
  return 0;
}
