#include <bits/stdc++.h>
using namespace std;
static const int MAXN = 1e5 + 10;
static const int OO = 0x3fffffff;
inline int read() {
  int ret = 0, f = 1;
  char c;
  while (c = getchar(), !isdigit(c)) f = c == 45 ? -1 : 1;
  while (isdigit(c)) {
    ret = (ret << 3) + (ret << 1);
    ret += c - 48;
    c = getchar();
  }
  return f * ret;
}
map<int, int> vis;
vector<int> v;
vector<int> a;
int n;
int main() {
  n = read();
  for (int i = 1; i <= n; ++i) {
    int x;
    x = read();
    if (vis[x]) {
      ++vis[x];
    } else {
      vis[x] = 1;
      v.push_back(x);
    }
    a.push_back(x);
  }
  sort(v.begin(), v.end());
  if (abs(v[v.size() - 1] - v[0]) != 2) {
    printf("%d\n", a.size());
    for (int i = 0; i < a.size(); ++i) {
      printf("%d ", a[i]);
    }
  } else {
    int num1 = vis[v[0]], num2 = vis[v[0] + 1], num3 = vis[v[v.size() - 1]];
    int mi = min(num1, num3);
    int mid = num2;
    int c1 = num1 - mi, d1 = num3 - mi, e1 = num2 + mi * 2;
    int mm = mid / 2;
    int c2 = num1 + mm, d2 = num3 + mm, e2 = num2 - mm * 2;
    int ans1, ans2, ans3, nb;
    int same1 = num1 + num2 + num3 - mi * 2;
    int same2 = num1 + num2 + num3 - mm * 2;
    if (same1 > same2) {
      ans1 = c2, ans2 = d2, ans3 = e2;
      nb = same2;
    } else {
      ans1 = c1, ans2 = d1, ans3 = e1;
      nb = same1;
    }
    printf("%d\n", nb);
    for (int i = 1; i <= ans1; ++i) {
      printf("%d ", v[0]);
    }
    for (int i = 1; i <= ans2; ++i) {
      printf("%d ", v[v.size() - 1]);
    }
    for (int i = 1; i <= ans3; ++i) {
      printf("%d ", v[0] + 1);
    }
    puts("");
  }
}
