#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using lld = long double;
using vi = vector<int>;
using vll = vector<long long>;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int x[n];
  for (int &u : x) {
    cin >> u;
  }
  sort(x, x + n);
  if ((x[n - 1] - x[0] == 0) || (x[n - 1] - x[0] == 1)) {
    cout << n << endl;
    for (int &u : x) {
      cout << u << ' ';
    }
  } else {
    int a = count(x, x + n, x[0]);
    int b = count(x, x + n, x[0] + 1);
    int c = count(x, x + n, x[0] + 2);
    if (2 * min(a, c) > 2 * (b / 2)) {
      cout << n - (2 * min(a, c)) << endl;
      if (a <= c) {
        b += 2 * a;
        c -= a;
        a = 0;
      } else {
        b += 2 * c;
        a -= c;
        c = 0;
      }
    } else {
      cout << n - (2 * (b / 2)) << endl;
      if (b % 2 == 0) {
        a += b / 2;
        c += b / 2;
        b = 0;
      } else {
        a += b / 2;
        c += b / 2;
        b = 1;
      }
    }
    while (a--) {
      cout << x[0] << ' ';
    }
    while (b--) {
      cout << x[0] + 1 << ' ';
    }
    while (c--) {
      cout << x[0] + 2 << ' ';
    }
  }
  return 0;
}
