#include <bits/stdc++.h>
using namespace std;
int num, a[100100], has[4], has_[4];
int main() {
  scanf("%d", &num);
  int min_ = 1e10, max_ = -1e10;
  for (int i = 1; i <= num; i++) {
    scanf("%d", &a[i]);
    min_ = min(min_, a[i]);
    max_ = max(a[i], max_);
  }
  if (max_ - min_ != 2) {
    printf("%d\n", num);
    for (int i = 1; i <= num; i++) printf("%d ", a[i]);
    printf("\n");
  } else {
    for (int i = 1; i <= num; i++) {
      if (a[i] == min_ + 2)
        has[3]++;
      else if (a[i] == min_)
        has[1]++;
      else
        has[2]++;
    }
    int tmp1 = has[1] + has[3] + (has[2] & 1);
    int tmp2 = has[2] + has[1] + has[3] - 2 * min(has[1], has[3]);
    if (tmp1 <= tmp2) {
      printf("%d\n", tmp1);
      has_[1] = has[1] + has[2] / 2;
      has_[2] = has[2] & 1;
      has_[3] = has[3] + has[2] / 2;
      for (int i = 1; i <= has_[1]; i++) printf("%d ", min_);
      for (int i = 1; i <= has_[2]; i++) printf("%d ", min_ + 1);
      for (int i = 1; i <= has_[3]; i++) printf("%d ", min_ + 2);
      printf("\n");
    } else {
      printf("%d\n", tmp2);
      if (has[1] >= has[3]) {
        has_[1] = has[1] - has[3];
        has_[2] = 2 * has[3] + has[2];
        has_[3] = 0;
        for (int i = 1; i <= has_[1]; i++) printf("%d ", min_);
        for (int i = 1; i <= has_[2]; i++) printf("%d ", min_ + 1);
        for (int i = 1; i <= has_[3]; i++) printf("%d ", min_ + 2);
        printf("\n");
      } else {
        has_[3] = has[3] - has[1];
        has_[2] = 2 * has[1] + has[2];
        has_[1] = 0;
        for (int i = 1; i <= has_[1]; i++) printf("%d ", min_);
        for (int i = 1; i <= has_[2]; i++) printf("%d ", min_ + 1);
        for (int i = 1; i <= has_[3]; i++) printf("%d ", min_ + 2);
        printf("\n");
      }
    }
  }
  return 0;
}
