#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  set<int> S;
  vector<int> tab(n);
  for (int i = 0; i < n; i++) {
    cin >> tab[i];
    S.insert(tab[i]);
  }
  if (S.size() == 1) {
    cout << n << endl;
    for (int i = 0; i < n; i++) cout << tab[i] << " ";
    return 0;
  } else if (S.size() == 2) {
    int a1, a3;
    set<int>::iterator it = S.begin();
    a1 = *it;
    it++;
    a3 = *it;
    if (a3 - a1 == 1) {
      cout << n << endl;
      for (int i = 0; i < n; i++) cout << tab[i] << " ";
      return 0;
    } else {
      int nb1 = 0, nb3 = 0;
      for (int i = 0; i < tab.size(); i++)
        if (tab[i] == a1)
          nb1++;
        else
          nb3++;
      cout << n - min(nb3, nb1) * 2 << endl;
      for (int i = 0; i < min(nb3, nb1) * 2; i++) cout << (a3 + a1) / 2 << " ";
      a3 = (nb3 < nb1) ? a1 : a3;
      for (int i = min(nb3, nb1) * 2; i < n; i++) cout << a3 << " ";
      return 0;
    }
  } else {
    int a[3], nb[3];
    memset(nb, 0, sizeof nb);
    int j = 0;
    for (set<int>::iterator it = S.begin(); it != S.end(); it++) {
      a[j++] = *it;
    }
    for (int i = 0; i < n; i++) {
      if (tab[i] == a[0])
        nb[0]++;
      else if (tab[i] == a[1])
        nb[1]++;
      else
        nb[2]++;
    }
    if (min(nb[0], nb[2]) < nb[1] / 2) {
      cout << n - (nb[1] / 2) * 2 << endl;
      j = 0;
      for (int i = 0; i < tab.size(); i++) {
        if (tab[i] == a[1]) {
          if (j < nb[1] / 2) {
            tab[i] = a[0];
            j++;
          } else {
            if (j < (nb[1] / 2) * 2) {
              tab[i] = a[2];
              j++;
            }
          }
        }
      }
    } else {
      cout << n - min(nb[0], nb[2]) * 2 << endl;
      int j1 = 0, j2 = 0;
      for (int i = 0; i < tab.size(); i++) {
        if (tab[i] == a[0]) {
          if (j1 < min(nb[0], nb[2])) {
            tab[i] = a[1];
            j1++;
          }
        } else if (tab[i] == a[2]) {
          if (j2 < min(nb[0], nb[2])) {
            tab[i] = a[1];
            j2++;
          }
        }
      }
    }
    for (int i = 0; i < n; i++) cout << tab[i] << " ";
  }
  return 0;
}
