#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
int n;
int a[maxn];
long long sum[maxn];
int main() {
  while (~scanf("%d", &n)) {
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    sort(a + 1, a + n + 1);
    memset(sum, 0, sizeof(sum));
    for (int i = 1; i <= n; i++) sum[i] = sum[i - 1] + a[i];
    long long ans = 0, pos = 1, len = 0;
    for (int i = 2; i <= n - 1; i++) {
      int L = 0, R = min(i - 1, n - i);
      while (R - L > 0) {
        int midL = (2 * L + R) / 3, midR = (L + 2 * R + 2) / 3;
        long long sumL = sum[i] - sum[i - midL - 1] + sum[n] - sum[n - midL];
        long long sumR = sum[i] - sum[i - midR - 1] + sum[n] - sum[n - midR];
        if (sumL * (midR * 2 + 1) < sumR * (midL * 2 + 1))
          L = midL + 1;
        else
          R = midR - 1;
      }
      long long temp = sum[i] - sum[i - L - 1] + sum[n] - sum[n - L] -
                       (long long)(2 * L + 1) * a[i];
      if (ans * (2 * L + 1) < temp * (2 * len + 1)) {
        ans = temp;
        pos = i;
        len = L;
      }
    }
    printf("%I64d\n", 2 * len + 1);
    for (int i = pos - len; i <= pos; i++) printf("%d ", a[i]);
    for (int i = n - len + 1; i <= n; i++)
      printf("%d%c", a[i], i == n ? '\n' : ' ');
  }
  return 0;
}
