#include <bits/stdc++.h>
using namespace std;
int INf = 0x3f3f3f3f;
const int N = 100010;
int a[N];
map<int, int> ct;
int cnt[4];
int i = 0;
int main() {
  int n;
  scanf("%d", &n);
  int minn = 1e6;
  int maxn = -1e6;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    ct[a[i]]++;
    minn = min(minn, a[i]);
    maxn = max(maxn, a[i]);
  }
  if (ct.size() <= 2) {
    if (maxn - minn == 1) {
      printf("%d\n", n);
      for (int i = 1; i < n; i++)
        if (a[i] != a[i + 1]) swap(a[i], a[i + 1]);
      for (int i = 1; i <= n; i++) printf("%d%c", a[i], " \n"[i == n]);
    } else {
      for (auto it = ct.begin(); it != ct.end(); it++, i++) {
        a[i] = it->first;
        cnt[i] = it->second;
      }
      int ans = min(cnt[0], cnt[1]);
      cnt[0] -= ans;
      cnt[1] -= ans;
      printf("%d\n", n - ans * 2);
      for (int i = 0; i < cnt[0]; i++) printf("%d ", a[0]);
      for (int i = 0; i < cnt[1]; i++) printf("%d ", a[1]);
      for (int i = 0; i < 2 * ans; i++) printf("%d ", a[0] + 1);
    }
  } else {
    for (auto it = ct.begin(); it != ct.end(); it++, i++) {
      a[i] = it->first;
      cnt[i] = it->second;
    }
    if (min(cnt[0], cnt[2]) * 2 >= cnt[1]) {
      int ans = min(cnt[0], cnt[2]);
      printf("%d\n", n - ans * 2);
      cnt[0] -= ans;
      cnt[2] -= ans;
      cnt[1] += ans * 2;
    } else {
      int ans = cnt[1] / 2;
      cnt[1] -= ans * 2;
      cnt[0] += ans;
      cnt[2] += ans;
      printf("%d\n", n - ans * 2);
    }
    for (int i = 0; i < cnt[0]; i++) printf("%d ", a[0]);
    for (int i = 0; i < cnt[2]; i++) printf("%d ", a[2]);
    for (int i = 0; i < cnt[1]; i++) printf("%d ", a[1]);
  }
  return 0;
}
