#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10000;
int x[N];
int main() {
  int n;
  scanf("%d", &n);
  int MA = -0x3f3f3f3f, MI = 0x3f3f3f3f;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x[i]);
    MA = max(MA, x[i]);
    MI = min(MI, x[i]);
  }
  if (MI + 1 == MA || MA == MI) {
    printf("%d\n", n);
    for (int i = 1; i <= n; i++) printf("%d ", x[i]);
    return 0;
  } else {
    int t1 = 0, t2 = 0, t3 = 0;
    for (int i = 1; i <= n; i++) {
      if (x[i] == MA)
        t1++;
      else if (x[i] == MI)
        t2++;
      else
        t3++;
    }
    int t = min(t1, t2);
    t3 = t3 / 2 * 2;
    if (2 * t >= t3) {
      t1 = t;
      t2 = t;
      cout << n - 2 * t << endl;
      for (int i = 1; i <= n; i++) {
        if (x[i] == MA) {
          if (t1 > 0) {
            printf("%d ", x[i] - 1);
            t1--;
          } else
            printf("%d ", x[i]);
        } else if (x[i] == MI) {
          if (t2 > 0) {
            printf("%d ", x[i] + 1);
            t2--;
          } else
            printf("%d ", x[i]);
        } else
          printf("%d ", x[i]);
      }
    } else {
      printf("%d\n", n - t3);
      t1 = t3 / 2;
      t2 = t3 / 2;
      for (int i = 1; i <= n; i++) {
        if (x[i] != MA && x[i] != MI) {
          if (t1 > 0) {
            printf("%d ", x[i] + 1);
            t1--;
          } else if (t2 > 0) {
            printf("%d ", x[i] - 1);
            t2--;
          } else
            printf("%d ", x[i]);
        } else
          printf("%d ", x[i]);
      }
    }
    return 0;
  }
  return 0;
}
