#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int TESTS = 1;
  while (TESTS--) {
    long long n, i, j, k, num, d1, d2;
    map<long long, long long> ct;
    cin >> n;
    long long v[3];
    for (i = 0; i < n; i++) {
      cin >> num;
      ct[num]++;
    }
    if (ct.size() == 1) {
      cout << n << "\n";
      for (auto i : ct) {
        for (j = 0; j < i.second; j++) cout << i.first << " ";
      }
      return 0;
    } else if (ct.size() == 2) {
      long long no[2], j = 0;
      for (auto i : ct) no[j++] = i.first;
      if (no[1] - no[0] == 2) {
        v[0] = no[0], v[2] = no[1];
        v[1] = (v[0] + 1);
        ct[v[1]] = 0;
      } else {
        cout << n << "\n";
        for (auto i : ct) {
          for (j = 0; j < i.second; j++) cout << i.first << " ";
        }
        return 0;
      }
    }
    j = 0;
    for (auto i : ct) v[j++] = i.first;
    d1 = min(ct[v[0]], ct[v[2]]), d2 = ct[v[1]] / 2;
    long long ans = n;
    if (d1 > d2) {
      ans -= 2 * d1;
      cout << ans << "\n";
      ct[v[0]] -= d1;
      ct[v[1]] += 2 * d1;
      ct[v[2]] -= d1;
      for (auto i : ct) {
        for (j = 0; j < i.second; j++) cout << i.first << " ";
      }
    } else {
      ans -= 2 * d2;
      cout << ans << "\n";
      ct[v[0]] += d2;
      ct[v[1]] -= 2 * d2;
      ct[v[2]] += d2;
      for (auto i : ct) {
        for (j = 0; j < i.second; j++) cout << i.first << " ";
      }
    }
  }
  return 0;
}
