#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  vector<int> v;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    v.push_back(x);
  }
  sort(v.begin(), v.end());
  int MIN = v[0];
  int MAX = v.back();
  if (MIN == MAX || MIN + 1 == MAX) {
    cout << n << endl;
    for (int i = 0; i < n; i++) {
      cout << v[i] << " ";
    }
    cout << endl;
  } else {
    int a = 0, b = 0, c = 0;
    for (int i = 0; i < n; i++) {
      if (v[i] == MIN) a++;
      if (v[i] == MIN + 1) b++;
      if (v[i] == MAX) c++;
    }
    cout << min(a + c + (b % 2), b + abs(a - c)) << endl;
    int mini = min(a, c);
    if (mini < b / 2) {
      a += b / 2;
      c += b / 2;
      b %= 2;
    } else {
      a -= mini;
      b += 2 * mini;
      c -= mini;
    }
    for (int i = 0; i < a; i++) {
      cout << MIN << " ";
    }
    for (int i = 0; i < b; i++) {
      cout << MIN + 1 << " ";
    }
    for (int i = 0; i < c; i++) {
      cout << MIN + 2 << " ";
    }
    cout << endl;
  }
  return 0;
}
