#include <bits/stdc++.h>
using namespace std;
const long long inf = (long long)1e9 + 10;
const long long linf = (long long)1e18 + 10;
const long long mod = (long long)(1e9 + 7);
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};
const double eps = 1e-10;
struct oreno_initializer {
  oreno_initializer() {
    cin.tie(0);
    ios::sync_with_stdio(0);
  }
} oreno_initializer;
int n, x[100100], mn = inf, mx = -inf;
signed main() {
  cin >> n;
  for (int(i) = (0); (i) < (n); ++(i)) {
    cin >> x[i];
    mn = min(mn, x[i]), mx = max(mx, x[i]);
  }
  if (mx - mn <= 1) {
    cout << n << '\n';
    for (int(i) = (0); (i) < (n); ++(i))
      cout << x[i] << (i == n - 1 ? '\n' : ' ');
    return 0;
  }
  int l = 0, m = 0, r = 0;
  for (int(i) = (0); (i) < (n); ++(i)) {
    if (x[i] == mn)
      l++;
    else if (x[i] == mx)
      r++;
    else
      m++;
  }
  if (m / 2 * 2 < min(l, r) * 2) {
    int tmp = min(l, r);
    l = r = tmp;
    cout << n - (min(l, r) * 2) << '\n';
    for (int(i) = (0); (i) < (n); ++(i)) {
      if (x[i] == mn && l)
        x[i] = mn + 1, l--;
      else if (x[i] == mx && r)
        x[i] = mx - 1, r--;
      cout << x[i] << (i == n - 1 ? '\n' : ' ');
    }
  } else {
    int tmp = m / 2 * 2;
    l = r = tmp / 2;
    cout << n - tmp << '\n';
    for (int(i) = (0); (i) < (n); ++(i)) {
      if (x[i] == mn + 1) {
        if (l)
          x[i] = mn, l--;
        else if (r)
          x[i] = mx, r--;
      }
      cout << x[i] << (i == n - 1 ? '\n' : ' ');
    }
  }
}
