#include <bits/stdc++.h>
#pragma GCC optimize("omit-frame-pointer")
#pragma GCC optimize("unroll-loops")
const int MAXINT = 2147483640;
const long long MAXLL = 9223372036854775800LL;
const long long MAXN = 1000000;
const double pi = 3.1415926535897932384626433832795;
using namespace std;
int kol[300000];
int x1[300000];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  srand(time(0));
  int n, mn = 1e9;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> x1[i];
    mn = min(x1[i], mn);
  }
  for (int i = 1; i <= n; i++) {
    x1[i] -= mn;
    kol[x1[i]]++;
  }
  if (kol[2] == 0) {
    cout << n << endl;
    for (int i = 1; i <= n; i++) cout << x1[i] + mn << " ";
    cout << endl;
    return 0;
  }
  int kol1 = kol[0];
  int kol2 = kol[1];
  int kol3 = kol[2];
  int ans = n;
  if (kol2 / 2 * 2 >= min(kol1, kol3) * 2) {
    ans -= kol2 / 2 * 2;
    kol1 += kol2 / 2;
    kol3 += kol2 / 2;
    kol2 -= kol2 / 2 * 2;
  } else {
    int kek = min(kol1, kol3);
    ans -= kek * 2;
    kol2 += kek * 2;
    kol1 -= kek;
    kol3 -= kek;
  }
  cout << ans << endl;
  for (int i = 1; i <= kol1; i++) cout << mn << " ";
  for (int i = 1; i <= kol2; i++) cout << mn + 1 << " ";
  for (int i = 1; i <= kol3; i++) cout << mn + 2 << " ";
  cout << endl;
  return 0;
}
