#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  int x = -10000000;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    x = max(a[i], x);
  }
  int cnt1 = 0, cnt2 = 0, cnt3 = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == x - 2) cnt1++;
    if (a[i] == x - 1) cnt2++;
    if (a[i] == x) cnt3++;
  }
  if (cnt1 == 0 || cnt3 == 0) {
    cout << n << endl;
    for (int i = 0; i < n; i++) cout << a[i] << " ";
    return 0;
  }
  if (n - 2 * cnt2 / 2 < n - 2 * min(cnt1, cnt3)) {
    int k = cnt2 - cnt2 % 2;
    cout << n - k << endl;
    for (int i = 1; i <= k / 2; i++) cout << x - 2 << " ";
    for (int i = 1; i <= k / 2; i++) cout << x << " ";
    for (int i = 0; i < cnt1; i++) cout << x - 2 << " ";
    for (int i = 0; i < cnt3; i++) cout << x << " ";
    if (cnt2 % 2 == 1) cout << x - 1 << " ";
    return 0;
  }
  if (cnt3 > cnt1) {
    cout << n - 2 * cnt1 << endl;
    int i = 0;
    for (i = 0; i < cnt3 - cnt1; i++) cout << x << " ";
    while (i != n) {
      cout << x - 1 << " ";
      i++;
    }
  } else {
    cout << n - 2 * cnt3 << endl;
    int i = 0;
    for (i = 0; i < cnt1 - cnt3; i++) cout << x - 2 << " ";
    while (i != n) {
      cout << x - 1 << " ";
      i++;
    }
  }
  return 0;
}
