#include <bits/stdc++.h>
using namespace ::std;
const int V = 1e5 + 25;
int arr[V];
map<int, int> mmap;
int main() {
  int n;
  cin >> n;
  int mx = INT_MIN;
  int mn = INT_MAX;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    mx = max(mx, arr[i]);
    mn = min(mn, arr[i]);
    mmap[arr[i]]++;
  }
  if (mx - mn < 2) {
    cout << n << endl;
    for (int i = 0; i < n; i++) {
      cout << arr[i] << " ";
    }
    cout << endl;
    return 0;
  }
  int cnt = 0;
  int a, b, c;
  int p, q, r;
  if (mmap.size() == 2) {
    for (auto x : mmap) {
      if (cnt == 0) p = x.first, a = x.second;
      if (cnt == 1) r = x.first, c = x.second;
      cnt++;
    }
    q = p + 1;
    b = 0;
  } else {
    for (auto x : mmap) {
      if (cnt == 0) p = x.first, a = x.second;
      if (cnt == 1) q = x.first, b = x.second;
      if (cnt == 2) r = x.first, c = x.second;
      cnt++;
    }
  }
  int b1 = b + 2 * min(a, c);
  int a1 = a - min(a, c);
  int c1 = c - min(a, c);
  int b2 = b % 2;
  int a2 = a + (b - b % 2) / 2;
  int c2 = c + (b - b % 2) / 2;
  int lhs = min(a1, a) + min(b1, b) + min(c1, c);
  int rhs = min(a2, a) + min(b2, b) + min(c2, c);
  if (lhs <= rhs) {
    printf("%d\n", lhs);
    for (int i = 0; i < a1; i++) printf("%d ", p);
    for (int i = 0; i < b1; i++) printf("%d ", q);
    for (int i = 0; i < c1; i++) printf("%d ", r);
  } else {
    printf("%d\n", rhs);
    for (int i = 0; i < a2; i++) printf("%d ", p);
    for (int i = 0; i < b2; i++) printf("%d ", q);
    for (int i = 0; i < c2; i++) printf("%d ", r);
  }
  return 0;
}
