#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  vector<int> vec(n);
  int i, a = 1000000;
  for (i = 0; i < n; i++) {
    cin >> vec[i];
    if (vec[i] < a) a = vec[i];
  }
  int x1, x2, x3, y1, y2, y3;
  x1 = x2 = x3 = 0;
  for (i = 0; i < n; i++) {
    if (vec[i] == a) x1++;
    if (vec[i] == a + 1) x2++;
    if (vec[i] == a + 2) x3++;
  }
  int ans = n + 1, prov;
  int ywin;
  for (y2 = 0; y2 <= n; y2++) {
    if ((x2 - y2) % 2 == 0) {
      y3 = (x2 + 2 * x3 - y2) / 2;
      y1 = n - y2 - y3;
      if ((y3 > 0 && x3 == 0) || (y2 > 0 && x3 == 0 && x2 == 0)) continue;
      if (0 <= y3 && y3 <= n && 0 <= y1 && y1 <= n) {
        prov = min(x1, y1) + min(x2, y2) + min(x3, y3);
        if (prov < ans) {
          ans = prov;
          ywin = y2;
        }
      }
    }
  }
  y2 = ywin;
  y3 = (x2 + 2 * x3 - y2) / 2;
  y1 = n - y2 - y3;
  cout << ans << "\n";
  for (i = 0; i < y1; i++) cout << a << " ";
  for (i = 0; i < y2; i++) cout << a + 1 << " ";
  for (i = 0; i < y3; i++) cout << a + 2 << " ";
}
