#include <bits/stdc++.h>
using namespace std;
map<int, int> s;
map<int, int>::iterator it;
int p[100005] = {0};
int mx = -1e9 + 7, mn = 1e9 + 7;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int t;
    scanf("%d", &t);
    s[t + 100005]++;
    p[i] = t;
  }
  int t = 0;
  vector<int> a;
  for (it = s.begin(); it != s.end(); it++) {
    int x = it->first, y = it->second;
    mx = max(mx, x);
    mn = min(mn, x);
    if (a.size() == 0) t = x;
    a.push_back(y);
  }
  if (a.size() == 1) {
    cout << n << endl;
    for (int i = 0; i < n; i++) {
      if (i == 0)
        printf("%d", p[i]);
      else
        printf(" %d", p[i]);
    }
    puts("");
  } else if (a.size() == 2) {
    if (mx - mn == 2) {
      a.push_back(0);
      a[2] = a[1];
      a[1] = 0;
      int tt = min(a[0], a[2]);
      cout << n - 2 * tt << endl;
      a[0] -= tt;
      a[1] += 2 * tt;
      a[2] -= tt;
      for (int i = 0; i < n; i++) {
        if (a[0] != 0) {
          if (i == 0)
            printf("%d", t - 100005);
          else
            printf(" %d", t - 100005);
          a[0]--;
        } else if (a[1] != 0) {
          if (i == 0)
            printf("%d", t - 100005 + 1);
          else
            printf(" %d", t - 100005 + 1);
          a[1]--;
        } else if (a[2] != 0) {
          printf(" %d", t - 100005 + 2);
          a[2]--;
        }
      }
      puts("");
      return 0;
    }
    cout << n << endl;
    for (int i = 0; i < n; i++) {
      if (i == 0)
        printf("%d", p[i]);
      else
        printf(" %d", p[i]);
    }
    puts("");
  } else {
    int tt = min(a[0], a[2]);
    int tt1 = a[1];
    if (tt1 > tt * 2) {
      tt = tt1 / 2;
      cout << n - tt * 2 << endl;
      a[0] += tt;
      a[1] -= 2 * tt;
      a[2] += tt;
      for (int i = 0; i < n; i++) {
        if (a[0] != 0) {
          if (i == 0)
            printf("%d", t - 100005);
          else
            printf(" %d", t - 100005);
          a[0]--;
        } else if (a[1] != 0) {
          if (i == 0)
            printf("%d", t - 100005 + 1);
          else
            printf(" %d", t - 100005 + 1);
          a[1]--;
        } else if (a[2] != 0) {
          printf(" %d", t - 100005 + 2);
          a[2]--;
        }
      }
      puts("");
      return 0;
    }
    cout << n - tt * 2 << endl;
    a[0] -= tt;
    a[1] += 2 * tt;
    a[2] -= tt;
    for (int i = 0; i < n; i++) {
      if (a[0] != 0) {
        if (i == 0)
          printf("%d", t - 100005);
        else
          printf(" %d", t - 100005);
        a[0]--;
      } else if (a[1] != 0) {
        if (i == 0)
          printf("%d", t - 100005 + 1);
        else
          printf(" %d", t - 100005 + 1);
        a[1]--;
      } else if (a[2] != 0) {
        printf(" %d", t - 100005 + 2);
        a[2]--;
      }
    }
    puts("");
  }
}
