#include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
const long long LIM = 0x3f3f3f3f3f3f3f3f;
const int INF = 0x3f3f3f3f;
const double eps = 1e-4;
const double PI = atan(1.0) * 4;
const int mod = 998244353;
int n, a[N + 10];
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  ;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + 1 + n);
  if (a[n] - a[1] < 2) {
    cout << n << "\n";
    for (int i = 1; i <= n; i++) cout << a[i] << " ";
    return 0;
  }
  int cnt[3] = {0, 0, 0};
  for (int i = 1; i <= n; i++)
    if (a[i] == a[1])
      cnt[0]++;
    else if (a[i] == a[n])
      cnt[2]++;
    else
      cnt[1]++;
  if (cnt[1] / 2 > min(cnt[0], cnt[2])) {
    cout << n - cnt[1] / 2 * 2 << "\n";
    for (int i = 1; i <= cnt[0] + cnt[1] / 2; i++) cout << a[1] << " ";
    for (int i = 1; i <= cnt[2] + cnt[1] / 2; i++) cout << a[n] << " ";
    if (cnt[1] % 2) cout << a[1] + 1;
    return 0;
  } else {
    cout << n - 2 * min(cnt[0], cnt[2]) << "\n";
    for (int i = 1; i <= cnt[1] + 2 * min(cnt[0], cnt[2]); i++)
      cout << a[1] + 1 << " ";
    for (int i = 1; i <= cnt[0] - min(cnt[0], cnt[2]); i++) cout << a[1] << " ";
    for (int i = 1; i <= cnt[2] - min(cnt[0], cnt[2]); i++) cout << a[n] << " ";
    return 0;
  }
  return 0;
}
