#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long int arr[n], a[3] = {100001, 100001, 100001}, ac[3] = {0},
                        bc1[3] = {0}, bc2[3] = {0};
  for (long long int i = 0; i < n; i++) {
    cin >> arr[i];
    if (i == 0) a[0] = arr[0];
    if (arr[i] != a[0])
      if (a[1] != 100001) {
        if (arr[i] != a[1]) {
          a[2] = arr[i];
          ac[2]++;
        } else
          ac[1]++;
      } else {
        a[1] = arr[i];
        ac[1]++;
      }
    else
      ac[0]++;
  }
  if (a[0] > a[1]) {
    long long int k, l;
    k = a[0];
    l = ac[0];
    a[0] = a[1];
    ac[0] = ac[1];
    a[1] = k;
    ac[1] = l;
  }
  if (a[2] < a[0]) {
    long long int k, l;
    k = a[2];
    l = ac[2];
    a[2] = a[1];
    ac[2] = ac[1];
    a[1] = a[0];
    ac[1] = ac[0];
    a[0] = k;
    ac[0] = l;
  }
  if (a[2] > a[0] && a[2] < a[1]) {
    long long int k, l;
    k = a[2];
    l = ac[2];
    a[2] = a[1];
    ac[2] = ac[1];
    a[1] = k;
    ac[1] = l;
  }
  if ((a[2] != 100001 && (a[2] - a[0]) != 2) || (ac[2] == 0 && ac[1] == 0) ||
      (ac[2] == 0 && (a[1] - a[0]) != 2)) {
    cout << n << endl;
    for (long long int i = 0; i < n; i++) cout << arr[i] << " ";
    return 0;
  }
  if (ac[2] == 0) {
    bc1[0] = ac[0];
    bc1[1] = ac[2];
    bc1[2] = ac[1];
    long long int t = ac[0];
    bc1[0] -= min(ac[0], ac[1]);
    bc1[2] -= min(ac[0], ac[1]);
    bc1[1] += (2 * min(ac[0], ac[1]));
    cout << (min(bc1[0], ac[0]) + min(bc1[1], ac[2]) + min(bc1[2], ac[1]))
         << endl;
    for (long long int i = 0; i < bc1[0]; i++) {
      cout << a[0] << " ";
    }
    for (long long int i = 0; i < bc1[1]; i++)
      cout << ((a[0] + a[1]) / 2) << " ";
    for (long long int i = 0; i < bc1[2]; i++) cout << a[1] << " ";
    return 0;
  }
  bc1[0] = ac[0];
  bc1[1] = ac[1];
  bc1[2] = ac[2];
  bc2[0] = ac[0];
  bc2[1] = ac[1];
  bc2[2] = ac[2];
  long long int c1 = 0, c2 = 0;
  long long int t = bc1[0];
  bc1[0] -= min(bc1[0], bc1[2]);
  bc1[1] += 2 * (min(t, bc1[2]));
  bc1[2] -= min(t, bc1[2]);
  c1 = (min(ac[0], bc1[0]) + min(ac[1], bc1[1]) + min(ac[2], bc1[2]));
  bc2[0] += bc2[1] / 2;
  bc2[2] += bc2[1] / 2;
  bc2[1] = bc2[1] % 2;
  c2 = (min(bc2[0], ac[0]) + min(bc2[1], ac[1]) + min(bc2[2], ac[2]));
  cout << min(c1, c2) << endl;
  if (c1 < c2) {
    for (long long int i = 0; i < bc1[0]; i++) cout << a[0] << " ";
    for (long long int i = 0; i < bc1[1]; i++) cout << a[1] << " ";
    for (long long int i = 0; i < bc1[2]; i++) cout << a[2] << " ";
  } else {
    for (long long int i = 0; i < bc2[0]; i++) cout << a[0] << " ";
    for (long long int i = 0; i < bc2[1]; i++) cout << a[1] << " ";
    for (long long int i = 0; i < bc2[2]; i++) cout << a[2] << " ";
  }
  return 0;
}
