#include <bits/stdc++.h>
using namespace std;
int a[5] = {0};
int main() {
  int n;
  scanf("%d", &n);
  int num1 = 100001, num2 = 100001, num3 = 100001;
  for (int i = 1; i <= n; i++) {
    int m;
    scanf("%d", &m);
    if (m == num1)
      a[1]++;
    else if (m == num2)
      a[2]++;
    else if (m == num3)
      a[3]++;
    else if (num1 == 100001)
      num1 = m, a[1]++;
    else if (num2 == 100001)
      num2 = m, a[2]++;
    else if (num3 == 100001)
      num3 = m, a[3]++;
  }
  int h = n;
  if (a[2] == 0 && a[3] == 0) {
    printf("%d\n", h);
    printf("%d", num1);
    for (int i = 2; i <= a[1]; i++) printf(" %d", num1);
  } else if (a[3] == 0) {
    if (num1 - num2 == 1 || num2 - num1 == 1) {
      printf("%d\n", h);
      printf("%d", num1);
      for (int i = 2; i <= a[1]; i++) printf(" %d", num1);
      for (int i = 1; i <= a[2]; i++) printf(" %d", num2);
    } else {
      int p = min(a[1], a[2]);
      num3 = (num1 + num2) / 2;
      h -= (2 * p);
      a[3] += (2 * p);
      a[1] -= p;
      a[2] -= p;
      printf("%d\n", h);
      for (int i = 1; i <= a[1]; i++) printf("%d ", num1);
      for (int i = 1; i <= a[2]; i++) printf("%d ", num2);
      for (int i = 1; i <= a[3]; i++) printf("%d ", num3);
    }
  } else {
    int k = (num1 + num2 + num3) / 3;
    if (num1 == k) {
      int p = min(a[1] / 2, min(a[2], a[3]));
      if (p == a[1] / 2) {
        int q = min(a[2], a[3]);
        a[1] += (2 * q);
        a[2] -= q;
        a[3] -= q;
        h -= (2 * q);
      } else {
        p = a[1] / 2;
        a[1] -= (2 * p);
        a[2] += p;
        a[3] += p;
        h -= (2 * p);
      }
    } else if (num2 == k) {
      int p = min(a[2] / 2, min(a[1], a[3]));
      if (p == a[2] / 2) {
        int q = min(a[1], a[3]);
        a[2] += (2 * q);
        a[1] -= q;
        a[3] -= q;
        h -= (2 * q);
      } else {
        p = a[2] / 2;
        a[2] -= (2 * p);
        a[1] += p;
        a[3] += p;
        h -= (2 * p);
      }
    } else if (num3 == k) {
      int p = min(a[3] / 2, min(a[1], a[2]));
      if (p == a[3] / 2) {
        int q = min(a[1], a[2]);
        a[3] += (2 * q);
        a[1] -= q;
        a[2] -= q;
        h -= (2 * q);
      } else {
        p = a[3] / 2;
        a[3] -= (2 * p);
        a[1] += p;
        a[2] += p;
        h -= (2 * p);
      }
    }
    printf("%d\n", h);
    for (int i = 1; i <= a[1]; i++) printf("%d ", num1);
    for (int i = 1; i <= a[2]; i++) printf("%d ", num2);
    for (int i = 1; i <= a[3]; i++) printf("%d ", num3);
  }
  return 0;
}
