#include <bits/stdc++.h>
using namespace std;
int sign(int x) {
  if (x < 0) return -1;
  if (x == 0) return 0;
  return 1;
}
int getans(map<int, int> &a, map<int, int> &b) {
  return min(a[0], b[0]) + min(a[1], b[1]) + min(a[2], b[2]);
}
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  int mn = 1000000, mx = -10000000;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    mn = min(mn, a[i]);
    mx = max(mx, a[i]);
  }
  int sum = 0;
  map<int, int> cnt, curr, best_ans;
  for (int i = 0; i < n; i++) {
    a[i] = a[i] - mn;
    sum += a[i];
    cnt[a[i]]++;
  }
  vector<int> ans(n, 0);
  if (mx == mn) {
    cout << n << endl;
    for (int i = 0; i < n; i++) {
      cout << a[i] << " ";
    }
    cout << endl;
  } else if (mx == mn + 1) {
    for (int i = 0; i < cnt[0]; i++) {
      ans[i] = 1;
    }
    cout << getans(curr, cnt) << endl;
    for (int i = 0; i < n; i++) {
      cout << ans[i] + mn << " ";
    }
  } else {
    curr[2] += sum / 2;
    curr[1] += sum % 2;
    int rng = curr[2] + curr[1];
    curr[0] = n - rng;
    int best_score = getans(cnt, curr);
    best_ans = curr;
    for (int i = rng; i < n; i++) {
      if (curr[2] > 0 && curr[0] > 0) {
        curr[2]--;
        curr[1] += 2;
        curr[0]--;
        if (getans(cnt, curr) < best_score) {
          best_ans = curr;
          best_score = getans(cnt, curr);
        }
      } else {
        break;
      }
    }
    int head = 0;
    for (int i = 0; i < best_ans[2]; i++) ans[head++] = 2;
    for (int i = 0; i < best_ans[1]; i++) ans[head++] = 1;
    cout << best_score << endl;
    for (int i = 0; i < n; i++) {
      cout << ans[i] + mn << " ";
    }
    cout << endl;
  }
}
