#include <bits/stdc++.h>
using namespace std;
const long long int SIZE = 2e5 + 10;
const long long int MOD = 1e9 + 7;
int A[SIZE];
int B[SIZE];
int main() {
  int n;
  cin >> n;
  const int shift = 1e5;
  int minn = SIZE;
  int maxx = 0;
  for (int i = 0; i < n; ++i) {
    int a;
    cin >> B[i];
    a = B[i];
    a = a + shift;
    A[a]++;
    minn = min(minn, a);
    maxx = max(maxx, a);
  }
  if (minn + 1 == maxx or minn == maxx) {
    cout << n << endl;
    for (int i = 0; i < n; ++i) {
      cout << B[i] << " ";
    }
    return 0;
  }
  int a = A[minn], b = A[minn + 1], c = A[maxx];
  int mid = minn + 1;
  int change = 0;
  int temp = (A[mid] / 2) * 2;
  if (change < temp) {
    change = temp;
    a = A[minn] + A[mid] / 2;
    b = A[mid] % 2;
    c = A[maxx] + A[mid] / 2;
    ;
  }
  temp = min(A[minn], A[maxx]) * 2;
  if (change < temp) {
    change = temp;
    a = A[minn] - temp / 2;
    b = A[mid] + temp;
    c = A[maxx] - temp / 2;
  }
  cout << n - change << endl;
  while (a--) {
    cout << minn - shift << " ";
  }
  while (b--) {
    cout << mid - shift << " ";
  }
  while (c--) {
    cout << maxx - shift << " ";
  }
  return 0;
}
