#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> all;
  all.resize(n);
  long long m = INT_MAX;
  for (int i = 0; i < (n); i++) {
    cin >> all[i];
    m = min(m, all[i]);
  }
  long long a[3];
  for (int i = 0; i < (3); i++) a[i] = 0;
  for (int i = 0; i < (n); i++) a[all[i] - m]++;
  if (a[0] == 0 || a[2] == 0) {
    cout << n << "\n";
    for (int i = 0; i < (a[0]); i++) cout << m << " ";
    for (int i = 0; i < (a[1]); i++) cout << m + 1 << " ";
    for (int i = 0; i < (a[2]); i++) cout << m + 2 << " ";
    return 0;
  }
  long long g[3];
  for (int i = 0; i < (3); i++) g[i] = a[i];
  g[0] += (g[1] / 2);
  g[2] += (g[1] / 2);
  g[1] %= 2;
  n = min(g[0], g[2]);
  long long kolunic = min(g[0], a[0]) + min(g[1], a[1]) + min(g[2], a[2]);
  for (int i = 0; i < (n); i++) {
    g[0]--;
    g[1] += 2;
    g[2]--;
    kolunic = min(kolunic, min(g[0], a[0]) + min(g[1], a[1]) + min(g[2], a[2]));
  }
  cout << kolunic << "\n";
  g[0] += n;
  g[1] -= (n * 2);
  g[2] += n;
  for (int i = 0; i < (n + 1); i++) {
    if (kolunic == min(g[0], a[0]) + min(g[1], a[1]) + min(g[2], a[2])) {
      for (int i = 0; i < (g[0]); i++) cout << m << " ";
      for (int i = 0; i < (g[1]); i++) cout << m + 1 << " ";
      for (int i = 0; i < (g[2]); i++) cout << m + 2 << " ";
      return 0;
    }
    g[0]--;
    g[1] += 2;
    g[2]--;
  }
}
