#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
int n;
int num[N];
long long sum[N];
long long cal(int l, int i) {
  return (sum[i] - sum[i - l - 1] + sum[n] - sum[n - l]);
}
int main() {
  scanf("%d", &n);
  memset(sum, 0, sizeof(sum));
  for (int i = 1; i <= n; i++) {
    scanf("%d", &num[i]);
  }
  sort(num + 1, num + 1 + n);
  for (int i = 1; i <= n; i++) sum[i] = sum[i - 1] + num[i];
  if (n == 2) {
    printf("%d\n", 2);
    printf("%d %d\n", num[1], num[2]);
  } else {
    int ans_i = 1, ans_l = 0;
    for (int i = 2; i < n; i++) {
      int l = 1, r = min(n - i, i - 1);
      while (l < r - 1) {
        int m1 = (2 * l + r) / 3;
        int m2 = (2 * r + l) / 3;
        if (cal(m2, i) * (m1 * 2 + 1) <= cal(m1, i) * (m2 * 2 + 1)) {
          r = m2 - 1;
        } else
          l = m1 + 1;
      }
      if (cal(r, i) * (l * 2 + 1) <= cal(l, i) * (r * 2 + 1))
        r = l;
      else
        r = r;
      if ((cal(r, i) - (long long)(r * 2 + 1) * num[i]) * (ans_l * 2 + 1) >
          (cal(ans_l, ans_i) - (long long)(ans_l * 2 + 1) * num[ans_i]) *
              (r * 2 + 1)) {
        ans_i = i;
        ans_l = r;
      }
    }
    printf("%d\n", ans_l * 2 + 1);
    printf("%d", num[ans_i - ans_l]);
    for (int i = ans_i - ans_l + 1; i <= ans_i; i++) printf(" %d", num[i]);
    for (int i = n - ans_l + 1; i <= n; i++) printf(" %d", num[i]);
    puts("");
  }
}
