#include <bits/stdc++.h>
using namespace std;
int readint() {
  char c;
  while (c = getchar(), (c < '0' || c > '9') && c != '-')
    ;
  bool flag = (c == '-');
  if (flag) c = getchar();
  int x = 0;
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - 48;
    c = getchar();
  }
  return flag ? -x : x;
}
inline string tos(int x) {
  string s;
  while (x) s = (char)(x % 10 + '0') + s, x /= 10;
  return s;
}
inline int toi(string s) {
  int rt = 0;
  for (int i = 0; i < s.size(); i++) rt = rt * 10 + (int)(s[i] - '0');
  return rt;
}
int v[100005];
int main() {
  ios_base::sync_with_stdio(false);
  int i, j;
  int a, b, c;
  a = b = c = 0;
  int n;
  scanf("%d", &n);
  int mx = -200000005;
  for (i = 0; i < n; i++) scanf("%d", &v[i]), mx = max(mx, v[i]);
  for (i = 0; i < n; i++) {
    if (v[i] == mx - 2)
      a++;
    else if (v[i] == mx - 1)
      b++;
    else
      c++;
  }
  int x = abs(a - c);
  int md = b % 2;
  int ans = 0;
  if (a == c && a > b) {
    printf("%d\n", b);
    for (i = 0; i < n; i++) printf("%d ", mx - 1);
    printf("\n");
    return 0;
  } else if (a == 0 || c == 0) {
    printf("%d\n", n);
    for (i = 0; i < n; i++) printf("%d ", v[i]);
    printf("\n");
    return 0;
  } else if (x + b < md + a + c) {
    ans = x + b;
    b = b + (max(a, c) - x) * 2;
    if (a < c)
      c -= a, a = 0;
    else
      a = a - c, c = 0;
  } else {
    ans = md + a + c;
    a = a + b / 2;
    c = c + b / 2;
    b = md;
  }
  printf("%d\n", ans);
  for (i = 0; i < a; i++) printf("%d ", mx - 2);
  for (i = 0; i < b; i++) printf("%d ", mx - 1);
  for (i = 0; i < c; i++) printf("%d ", mx);
  printf("\n");
  return 0;
}
