#include <bits/stdc++.h>
using namespace std;
int a[200005];
long long int sum[200005];
int b[200005];
int main() {
  int n;
  scanf("%d", &n);
  int i;
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  sort(a + 1, a + 1 + n);
  for (i = 1; i <= n; i++) {
    sum[i] = sum[i - 1] + a[i];
  }
  int len = 0, lentemp, len1, len2, m = 1, t = 0;
  double ans = 0;
  for (i = 2; i <= n - 1; i++) {
    len1 = 1;
    len2 = n - i < i - 1 ? n - i : i - 1;
    while (len2 >= len1) {
      int mid1 = (len1 * 2 + len2) / 3;
      int mid2 = (len1 + len2 * 2 + 2) / 3;
      double ans1 = (double)sum[i] - sum[i - mid1 - 1] + sum[n] - sum[n - mid1];
      ans1 = ans1 / (2 * mid1 + 1);
      double ans2 = (double)sum[i] - sum[i - mid2 - 1] + sum[n] - sum[n - mid2];
      ans2 = ans2 / (2 * mid2 + 1);
      if (ans1 >= ans2) {
        len2 = mid2 - 1;
      } else {
        len1 = mid1 + 1;
      }
    }
    lentemp = len1;
    double temp =
        (double)sum[i] - sum[i - lentemp - 1] + sum[n] - sum[n - lentemp];
    temp = temp / (2 * lentemp + 1);
    temp = temp - a[i];
    if (temp > ans) {
      m = i;
      len = lentemp;
      ans = temp;
    }
  }
  int j;
  if (ans <= 0) {
    printf("1\n%d", a[1]);
    return 0;
  }
  printf("%d\n", len * 2 + 1);
  for (i = n; n - i < len; i--) {
    b[i] = 1;
  }
  for (i = m; m - i <= len; i--) {
    b[i] = 1;
  }
  for (i = 1; i <= n; i++) {
    if (b[i] == 1) {
      printf("%d ", a[i]);
    }
  }
}
