#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<int> A(n);
  for (int i = 0; i < n; i++) {
    cin >> A[i];
  }
  sort(A.begin(), A.end());
  int a = 0, b = 0, c = 0;
  int x = 0, y = 0, z = 0;
  int mid;
  mid = (A[n - 1] - A[0]) == 2 ? A[0] + 1 : A[n - 1];
  for (int i = 0; i < n; i++) {
    if (A[i] == mid - 1) a++;
    if (A[i] == mid) b++;
    if (A[i] == mid + 1) c++;
  }
  x = a, y = b, z = c;
  int t = min(a, c);
  if (c == 0) {
  } else if (b / 2 * 2 > t * 2) {
    t = b / 2;
    y -= 2 * t;
    x += t;
    z += t;
  } else {
    y += 2 * t;
    x -= t;
    z -= t;
  }
  int rem = min(a, x) + min(b, y) + min(c, z);
  cout << rem << endl;
  for (int i = 0; i < x; i++) cout << mid - 1 << ' ';
  for (int i = 0; i < y; i++) cout << mid << ' ';
  for (int i = 0; i < z; i++) cout << mid + 1 << ' ';
  cout << "\n";
  return 0;
}
