#include <bits/stdc++.h>
using namespace std;
long long arr[200010];
long long pre[200010];
double f(int k, int i, int n) {
  long long sum = 0;
  sum += pre[n] - pre[n - k];
  sum += pre[i] - pre[i - k - 1];
  return (1.000000 * sum) / (2 * k + 1);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> arr[i];
  sort(arr, arr + n + 1);
  pre[0] = 0;
  for (int i = 1; i <= n; i++) pre[i] = pre[i - 1] + arr[i];
  double ans = 0;
  double median, mean;
  int index = 1;
  int len = 0;
  for (int i = 1; i <= n; i++) {
    if (i == 1 || i == n) continue;
    median = arr[i];
    long long low = 0, high = min(i - 1, n - i);
    long long mid;
    while (low < high) {
      mid = low + (high - low) / 2;
      if (f(mid, i, n) > f(mid + 1, i, n))
        high = mid;
      else
        low = mid + 1;
    }
    mean = f(low, i, n);
    if (mean - median > ans) {
      ans = mean - median;
      index = i;
      len = low;
    }
  }
  cout << 2 * len + 1 << "\n";
  for (int p = index - len; p <= index; p++) cout << arr[p] << " ";
  for (int p = n; p >= n - len + 1; p--) cout << arr[p] << " ";
  cout << "\n";
}
