#include <bits/stdc++.h>
using namespace std;
long long a[100005];
long long MIN(long long a, long long b) { return a < b ? a : b; }
int main() {
  long long n, max, min, flag = 0;
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    if (i == 1) {
      max = a[i];
      min = a[i];
    } else {
      if (a[i] > max) max = a[i];
      if (a[i] < min) min = a[i];
      if (max - min == 2) {
        flag = 1;
      }
    }
  }
  if (flag == 0) {
    cout << n << endl;
    for (int i = 1; i < n; i++) cout << a[i] << " ";
    cout << a[n] << endl;
  } else {
    long long maxn = 0, minn = 0, o, pin = (min + max) / 2, p = 0;
    for (int i = 1; i <= n; i++) {
      if (a[i] == max)
        maxn++;
      else if (a[i] == min)
        minn++;
      else
        p++;
    }
    o = MIN(maxn, minn);
    long long p1 = p / 2;
    if (o > p1) {
      cout << n - o * 2 << endl;
      long long j = 1, k = j;
      for (j; j < k + maxn - o; j++) {
        cout << max << " ";
      }
      k = j;
      for (j; j < k + minn - o; j++) {
        cout << min << " ";
      }
      for (j; j <= n; j++) {
        if (j != n)
          cout << pin << " ";
        else
          cout << pin << endl;
      }
    } else {
      cout << n - p1 * 2 << endl;
      long long j = 1, k = j;
      for (j; j < k + maxn + p1; j++) {
        cout << max << " ";
      }
      k = j;
      for (j; j < k + minn + p1; j++) {
        cout << min << " ";
      }
      for (j; j <= n; j++) {
        if (j != n)
          cout << pin << " ";
        else
          cout << pin << endl;
      }
    }
  }
}
