#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int arr[N], tot[3];
int main() {
  int n, mn = INT_MAX;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    mn = min(mn, arr[i]);
  }
  for (int i = 0; i < n; i++) tot[arr[i] - mn]++;
  int mi = min(tot[0], tot[2]);
  if (tot[0] > 0 && tot[1] > 0 && tot[2] > 0 && tot[1] / 2 > mi) {
    cout << n - (tot[1] / 2) * 2 << endl;
    tot[0] += tot[1] / 2, tot[2] += tot[1] / 2;
    tot[1] %= 2;
  } else {
    cout << n - mi * 2 << endl;
    tot[0] -= mi, tot[1] += mi * 2, tot[2] -= mi;
  }
  int id = 0;
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < tot[i]; j++) cout << mn + i << " ";
  }
  return 0;
}
