#include <bits/stdc++.h>
using namespace std;
int num[100005];
int main() {
  int i, n, maxx, minn, midd, cnt1 = 0, cnt2 = 0, cnt3 = 0, cntt;
  cin >> n;
  for (i = 0; i < n; i++) {
    scanf("%d", &num[i]);
  }
  sort(num, num + n);
  maxx = num[n - 1];
  minn = num[0];
  midd = (maxx + minn) / 2;
  if (maxx - minn <= 1) {
    cout << n << endl;
    for (i = 0; i < n; i++) cout << num[i] << " ";
  } else {
    for (i = 0; i < n; i++) {
      if (num[i] == minn) {
        cnt1++;
      } else if (num[i] == midd) {
        cnt2++;
      } else {
        cnt3++;
      }
    }
    cntt = min(cnt1, cnt3);
    if (cnt2 <= cntt * 2) {
      cout << n - (cntt * 2) << endl;
      cnt1 -= cntt;
      cnt3 -= cntt;
      cnt2 += 2 * cntt;
    } else {
      cout << n - (cnt2 - cnt2 % 2) << endl;
      cnt1 += cnt2 / 2;
      cnt3 += cnt2 / 2;
      cnt2 = cnt2 % 2;
    }
    for (i = 0; i < cnt1; i++) cout << minn << " ";
    for (i = 0; i < cnt2; i++) cout << midd << " ";
    for (i = 0; i < cnt3; i++) cout << maxx << " ";
    cout << endl;
  }
  return 0;
}
