#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t = 1;
  while (t--) {
    long long int n;
    cin >> n;
    map<long long int, long long int> m;
    long long int sum = 0;
    for (long long int i = 0; i < n; i++) {
      long long int q;
      cin >> q;
      m[q]++;
      sum += q;
    }
    auto itr = m.begin();
    long long int a = itr->first;
    if (m.size() == 1) {
      cout << n << endl;
      for (long long int i = 0; i < n; i++) cout << a << " ";
      return 0;
    }
    itr++;
    long long int b = itr->first;
    pair<long long int, pair<long long int, long long int> > p;
    p.first = n + 100;
    if (m.size() == 2 && (a + 1) == b) {
      for (long long int f = 0; f <= n; f++) {
        if ((a * f + (n - f) * b) == sum) {
          long long int penalty = min(f, m[a]) + min(n - f, m[a + 1]);
          if (p.first > penalty) {
            p.first = penalty;
            p.second.first = f;
            p.second.second = n - f;
          }
        }
      }
    } else {
      long long int c = a + 2;
      for (long long int f = 0; f <= n; f++) {
        long long int rsum = sum - (f * a);
        long long int rfreq = n - f;
        long long int x = (c * rfreq) - rsum;
        long long int y = n - x - f;
        long long int penalty = min(f, m[a]) + min(y, m[a + 2]);
        if (m.count(a + 1)) {
          penalty += min(x, m[a + 1]);
        }
        if (f >= 0 && x >= 0 && y >= 0)
          if (p.first > penalty) {
            p.first = penalty;
            p.second.first = f;
            p.second.second = x;
          }
      }
    }
    cout << p.first << endl;
    for (int i = 0; i < p.second.first; i++) cout << a << " ";
    for (int i = 0; i < p.second.second; i++) cout << a + 1 << " ";
    n = n - (p.second.first + p.second.second);
    for (int i = 0; i < n; i++) cout << a + 2 << " ";
  }
  return 0;
}
