#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e9;
const int mod = (int)1e9 + 7;
const int MAX = (int)1e5 + 5;
int store[MAX];
vector<int> num;
int cnt[3];
int main(void) {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < (n); ++i) scanf("%d", store + i);
  sort(store, store + n);
  for (int i = 0; i < (n); ++i)
    if (i == 0 || store[i] != store[i - 1]) {
      num.push_back(store[i]);
    }
  sort((num).begin(), (num).end());
  if (num.size() <= 2) {
    if (num.size() == 2 && num[0] + 2 == num[1]) {
      for (int i = 0; i < (n); ++i) {
        if (store[i] == num[0])
          cnt[0]++;
        else
          cnt[1]++;
      }
      int v = min(cnt[0], cnt[1]);
      printf("%d\n", max(cnt[0], cnt[1]) - v);
      for (int i = 0; i < (cnt[0] - v); ++i) printf("%d ", num[0]);
      for (int i = 0; i < (cnt[1] - v); ++i) printf("%d ", num[1]);
      for (int i = 0; i < (v * 2); ++i) printf("%d ", (num[0] + num[1]) / 2);
    } else {
      printf("%d\n", n);
      for (int i = 0; i < (n); ++i) printf("%d ", store[i]);
    }
  } else {
    for (int i = 0; i < (n); ++i) {
      if (store[i] == num[1])
        cnt[1]++;
      else if (store[i] == num[2])
        cnt[2]++;
      else
        cnt[0]++;
    }
    if ((cnt[1] / 2) > min(cnt[0], cnt[2])) {
      printf("%d\n", cnt[0] + cnt[2] + cnt[1] % 2);
      for (int i = 0; i < (cnt[0] + cnt[1] / 2); ++i) printf("%d ", num[0]);
      for (int i = 0; i < (cnt[2] + cnt[1] / 2); ++i) printf("%d ", num[2]);
      if (cnt[1] % 2) printf("%d ", num[1]);
    } else {
      int v = min(cnt[0], cnt[2]);
      printf("%d\n", max(cnt[0], cnt[2]) - v + cnt[1]);
      for (int i = 0; i < (cnt[0] - v); ++i) printf("%d ", num[0]);
      for (int i = 0; i < (cnt[2] - v); ++i) printf("%d ", num[2]);
      for (int i = 0; i < (cnt[1] + v * 2); ++i) printf("%d ", num[1]);
    }
  }
  return 0;
}
