#include <bits/stdc++.h>
using namespace std;
int a[1000010], n, pos = 1, len;
long long sum[1000010];
double ans;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) sum[i] = sum[i - 1] + a[i];
  for (int i = 1; i <= n; i++) {
    int l = 1, r = min(i - 1, n - i), res = 0;
    while (r >= l) {
      int mid = (l + r) >> 1;
      double res1 = 1.0 * (sum[n] - sum[n - mid] + sum[i] - sum[i - mid - 1]) /
                    (2 * mid + 1);
      double res2 = 1.0 * (sum[n] - sum[n - mid + 1] + sum[i] - sum[i - mid]) /
                    (2 * mid - 1);
      if (res1 > res2) {
        res = mid;
        l = mid + 1;
      } else
        r = mid - 1;
    }
    double ans1 = 1.0 * (sum[n] - sum[n - res] + sum[i] - sum[i - res - 1]) /
                      (2 * res + 1) -
                  a[i];
    if (ans1 > ans) {
      len = res;
      ans = ans1;
      pos = i;
    }
  }
  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]);
  printf("%d\n", a[pos]);
  return 0;
}
