#include <bits/stdc++.h>
const long long int mod = 1000000007;
using namespace std;
int minimum(int x, int y) {
  if (x < y) {
    return x;
  } else
    return y;
}
int maximum(int x, int y) {
  if (x > y) {
    return x;
  } else
    return y;
}
int main() {
  std::ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int min = a[0];
  int max = a[0];
  for (int i = 0; i < n; i++) {
    if (a[i] > max) {
      max = a[i];
    }
    if (a[i] < min) {
      min = a[i];
    }
  }
  if (min == max - 1) {
    cout << n << endl;
    for (int i = 0; i < n; i++) {
      cout << a[i] << " ";
    }
    cout << endl;
  } else {
    int count_min = 0;
    int count_max = 0;
    int count_avg = 0;
    for (int i = 0; i < n; ++i) {
      if (a[i] == min) {
        count_min++;
      } else if (a[i] == max) {
        count_max++;
      } else {
        count_avg++;
      }
    }
    int count = count_avg % 2;
    if (count + 2 * minimum(count_min, count_max) < count_avg) {
      cout << count + count_min + count_max << endl;
      for (int i = 0; i < count_min; i++) {
        cout << min << " ";
      }
      for (int i = 0; i < count_max; i++) {
        cout << max << " ";
      }
      if (count == 1) cout << min + 1 << " ";
      for (int i = 1; i <= count_avg / 2; i++) {
        cout << min << " " << max << " ";
      }
      cout << endl;
    } else {
      cout << count_avg + maximum(count_min, count_max) -
                  minimum(count_min, count_max)
           << endl;
      for (int i = 0;
           i < maximum(count_min, count_max) - minimum(count_min, count_max);
           i++) {
        if (count_max == maximum(count_min, count_max))
          cout << max << " ";
        else
          cout << min << " ";
      }
      for (int i = 0; i < n - maximum(count_min, count_max) +
                              minimum(count_min, count_max);
           i++) {
        cout << min + 1 << " ";
      }
      cout << endl;
    }
  }
  return 0;
}
