#include <bits/stdc++.h>
using namespace std;
const long long maxn = 200005;
long long n, ansmid, anslen;
long long sum[maxn], a[maxn];
double ansval;
signed main() {
  scanf("%lld", &n);
  for (long long i = 1; i <= n; i++) scanf("%lld", &a[i]);
  sort(a + 1, a + 1 + n);
  for (long long i = 1; i <= n; i++) sum[i] = sum[i - 1] + a[i];
  ansval = -1.0;
  for (long long i = 1; i <= n; i++) {
    long long L = 0, R = min(i - 1, n - i) + 1;
    while (L + 1 < R) {
      long long mid = (L + R) >> 1;
      long long lst = sum[n] - sum[n - mid + 1] + sum[i] - sum[i - mid];
      long long now = sum[n] - sum[n - mid] + sum[i] - sum[i - mid - 1];
      if (1.0 * lst / (2 * mid - 1) < 1.0 * now / (2 * mid + 1))
        L = mid;
      else
        R = mid;
    }
    double res =
        1.0 * (sum[n] - sum[n - L] + sum[i] - sum[i - L - 1]) / (2 * L + 1) -
        a[i];
    if (res > ansval) ansval = res, ansmid = i, anslen = L;
  }
  printf("%lld\n", 2 * anslen + 1);
  for (long long i = ansmid - anslen; i <= ansmid; i++) printf("%lld ", a[i]);
  for (long long i = n - anslen + 1; i <= n; i++) printf("%lld ", a[i]);
  puts("");
  return 0;
}
