#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using uint8 = unsigned char;
using uint16 = unsigned short int;
using uint32 = unsigned int;
using uint64 = unsigned long long;
using int8 = signed char;
using int16 = short int;
using int32 = int;
using int64 = long long;
using pi32 = std::pair<int32, int32>;
using pi32pi32 = std::pair<int32, pi32>;
using vi32 = std::vector<int32>;
using qi32 = std::queue<int32>;
using spi32 = std::set<pi32>;
using spi32it = spi32::iterator;
namespace oct {
const int tn4[4][2] = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
const int tn8[8][2] = {{1, 0},  {1, 1},   {0, 1},  {-1, 1},
                       {-1, 0}, {-1, -1}, {0, -1}, {1, -1}};
void sync();
template <typename _Tp>
_Tp &mad(_Tp &x, _Tp y);
template <typename _Tp>
_Tp &mid(_Tp &x, _Tp y);
template <typename _Tp>
bool in(_Tp x, _Tp l, _Tp r);
template <typename _Tp>
_Tp sqr(_Tp x);
inline void sync() {
  std::ios::sync_with_stdio(0);
  std::cin.tie(0), std::cout.tie(0);
}
template <typename _Tp>
inline _Tp &mad(_Tp &x, _Tp y) {
  return x = std::max(x, y);
}
template <typename _Tp>
inline _Tp &mid(_Tp &x, _Tp y) {
  return x = std::min(x, y);
}
template <typename _Tp>
inline bool in(_Tp x, _Tp l, _Tp r) {
  return l <= x && x <= r;
}
template <typename _Tp>
inline _Tp sqr(_Tp x) {
  return x * x;
}
}  // namespace oct
const int N = 200005;
int64 u(int l);
int64 s(int l, int r);
int64 sg(int m, int l);
double aver(int m, int l);
int n, l, r, ml, mr, ans, max, mal;
int a[N];
int64 sum[N];
inline int64 u(int l) { return l << 1 | 1; }
inline int64 s(int l, int r) { return sum[r] - sum[l - 1]; }
inline int64 sg(int m, int l) { return s(m - l, m) + s(n - l + 1, n); }
inline bool cmp(int x, int xl, int y, int yl) {
  return sg(x, xl) * u(yl) - a[x] * u(xl) * u(yl) <
         sg(y, yl) * u(xl) - a[y] * u(xl) * u(yl);
}
int main() {
  oct::sync();
  std::cin >> n;
  for (int i = 1; i <= n; ++i) std::cin >> a[i];
  if (n <= 2) {
    std::cout << 1 << std::endl;
    std::cout << a[1] << std::endl;
    return 0;
  }
  std::sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; ++i) sum[i] = sum[i - 1] + a[i];
  for (int m = 1; m <= n; ++m) {
    l = 0, r = std::min(m - 1, n - m);
    while (l < r - 1) {
      ml = (l + l + r) / 3;
      mr = (l + r + r) / 3;
      if (sg(m, ml) * u(mr) < sg(m, mr) * u(ml)) {
        l = ml + 1;
      } else {
        r = mr;
      }
    }
    if (l < r) l = sg(m, l) * u(r) < sg(m, r) * u(l) ? r : l;
    if (m > 1 && cmp(m, l, max, mal)) continue;
    max = m, mal = l;
  }
  std::cout << mal * 2 + 1 << std::endl;
  for (int i = mal; i; --i) std::cout << a[max - i] << ' ';
  std::cout << a[max];
  for (int i = mal - 1; ~i; --i) std::cout << ' ' << a[n - i];
  std::cout << std::endl;
  return 0;
}
