#include <bits/stdc++.h>
using namespace std;
int a[100010], ans[3];
int main() {
  int n, mn;
  while (~scanf("%d", &n)) {
    mn = 0x3f3f3f;
    memset(ans, 0, sizeof(ans));
    for (int i = 0; i < n; i++) {
      scanf("%d", &a[i]);
      mn = min(a[i], mn);
    }
    for (int i = 0; i < n; i++) {
      a[i] -= mn;
      ans[a[i]]++;
    }
    sort(a, a + n);
    if (a[n - 1] < 2) {
      printf("%d\n", n);
      for (int i = 0; i < n; i++) printf("%d ", a[i] + mn);
    } else {
      int temp = min(ans[0], ans[2]);
      int temp2 = ans[1];
      if (temp2 > temp * 2) {
        ans[0] = ans[0] + temp2 / 2;
        ans[1] = ans[1] - temp2 / 2 * 2;
        ans[2] = ans[2] + temp2 / 2;
      } else {
        ans[0] = ans[0] - temp;
        ans[1] = ans[1] + temp * 2;
        ans[2] = ans[2] - temp;
      }
      printf("%d\n", n - max(2 * temp, temp2 / 2 * 2));
      for (int i = 0; i < 3; i++)
        for (int j = 0; j < ans[i]; j++) printf("%d ", i + mn);
    }
    printf("\n");
  }
  return 0;
}
