#include <bits/stdc++.h>
using namespace std;
const int maxn = 200005;
int a[maxn];
long long sum[maxn];
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
    }
    sort(a + 1, a + 1 + n);
    for (int i = 1; i <= n; i++) {
      sum[i] = sum[i - 1] + a[i];
    }
    double ans = 0.0;
    int len = 0, pos = 1;
    for (int i = 2; i <= n; i++) {
      int l = 1, r = min(n - i, i - 1), mid, res = 0;
      while (l <= r) {
        mid = (l + r) >> 1;
        double aver1 = 1.0 *
                       (sum[n] - sum[n - mid] + sum[i] - sum[i - mid - 1]) /
                       (2 * mid + 1);
        double aver2 = 1.0 *
                       (sum[n] - sum[n - mid + 1] + sum[i] - sum[i - mid]) /
                       (2 * mid - 1);
        if (aver1 > aver2) {
          res = mid;
          l = mid + 1;
        } else {
          r = mid - 1;
        }
      }
      double tmp = 1.0 * (sum[n] - sum[n - res] + sum[i] - sum[i - res - 1]) /
                       (2 * res + 1) -
                   a[i];
      if (tmp > ans) {
        ans = tmp;
        pos = i;
        len = res;
      }
    }
    printf("%d\n", len * 2 + 1);
    for (int i = pos - len; i <= pos; i++) printf("%d ", a[i]);
    for (int i = n - len + 1; i <= n; i++) printf("%d ", a[i]);
    puts("");
  }
  return 0;
}
