#include <bits/stdc++.h>
using namespace std;
long long n, a[200010], i, sum[200010], j, k, l, r, m1, m2, p = 0, pp = 1;
int main() {
  long long ans = 0;
  scanf("%lld", &n);
  for (i = 1; i <= n; i++) scanf("%lld", &a[i]);
  sort(a + 1, a + 1 + n);
  sum[0] = 0;
  for (i = 1; i <= n; i++) sum[i] = sum[i - 1] + a[i];
  for (i = 2; i < n; i++) {
    k = min(i - 1, n - i);
    l = 1;
    r = k;
    for (j = 0; j <= 100; j++) {
      m1 = (2 * l + r) / 3;
      m2 = (2 * r + l + 2) / 3;
      if ((sum[n] - sum[n - m1] + sum[i] - sum[i - 1 - m1]) * (m2 * 2 + 1) >=
          (sum[n] - sum[n - m2] + sum[i] - sum[i - 1 - m2]) * (m1 * 2 + 1))
        r = m2 - 1;
      else
        l = m1 + 1;
    }
    if ((sum[n] - sum[n - l] + sum[i] - sum[i - 1 - l] - a[i] * (2 * l + 1)) *
            (2 * p + 1) >
        ans * (2 * l + 1)) {
      ans = sum[n] - sum[n - l] + sum[i] - sum[i - 1 - l] - a[i] * (2 * l + 1);
      p = l;
      pp = i;
    }
  }
  if (n > 2) {
    cout << 2 * p + 1 << "\n";
    for (i = pp - p; i <= pp; i++) cout << a[i] << " ";
    for (i = n - p + 1; i <= n; i++) {
      cout << a[i];
      if (i != n) cout << " ";
    }
  } else {
    cout << n << "\n";
    for (i = 1; i <= n; i++) {
      cout << a[i];
      if (i != n) cout << " ";
    }
  }
}
