#include <bits/stdc++.h>
using namespace std;
int mn = 1e9;
void prt(vector<int> a) {
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < a[i]; j++) {
      cout << mn + i << ' ';
    }
  }
  cout << endl;
}
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  vector<int> cnt(3);
  int mx = -1e9;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    mn = min(a[i], mn);
    mx = max(a[i], mx);
  }
  if (mx - mn < 2) {
    cout << n << endl;
    for (auto i : a) {
      cout << i << ' ';
    }
    cout << endl;
    return 0;
  }
  for (int i = 0; i < n; i++) {
    cnt[a[i] - mn]++;
  }
  vector<int> ans = cnt;
  int answer = n;
  vector<int> cur = cnt;
  int s = cur[1] / 2;
  cur[0] += s;
  cur[2] += s;
  cur[1] -= 2 * s;
  s = min(cur[0], cur[2]);
  for (int i = 0; i <= s; i++) {
    int c = 0;
    for (int j = 0; j < 3; j++) {
      c += min(cur[j], cnt[j]);
    }
    if (c < answer) {
      answer = c;
      ans = cur;
    }
    cur[0]--;
    cur[2]--;
    cur[1] += 2;
  }
  cout << answer << endl;
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < ans[i]; j++) {
      cout << mn + i << ' ';
    }
  }
  cout << endl;
  return 0;
}
