Problem: Define the simple skewness of a collection of numbers to be the collection's mean minus its median. You are given a list of n (not necessarily distinct) integers. Find the non-empty subset (with repetition) with the maximum simple skewness.

The mean of a collection is the average of its elements. The median of a collection is its middle element when all of its elements are sorted, or the average of its two middle elements if it has even size.

Input

The first line of the input contains a single integer n (1 ≤ n ≤ 200 000) — the number of elements in the list.

The second line contains n integers xi (0 ≤ xi ≤ 1 000 000) — the ith element of the list.

Output

In the first line, print a single integer k — the size of the subset.

In the second line, print k integers — the elements of the subset in any order.

If there are multiple optimal subsets, print any.

Examples

Input

4
1 2 3 12


Output

3
1 2 12 


Input

4
1 1 2 2


Output

3
1 1 2 


Input

2
1 2


Output

2
1 2

Note

In the first case, the optimal subset is <image>, which has mean 5, median 2, and simple skewness of 5 - 2 = 3.

In the second case, the optimal subset is <image>. Note that repetition is allowed.

In the last case, any subset has the same median and mean, so all have simple skewness of 0.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
int n;
int nums[200111];
long long sums[200111];
long long Sum(int l, int r) {
  if (l > r) return 0;
  return sums[r] - sums[l - 1];
}
int main() {
  int i;
  int l, r, mid, best;
  pair<long long, long long> cur, prev;
  pair<long long, long long> BestAns = make_pair(0, 1);
  bool onecenter = true;
  int center = 1, dist = 0;
  scanf("%d", &n);
  sums[0] = 0;
  for (i = 1; i <= n; i++) {
    scanf("%d", &nums[i]);
  }
  sort(nums + 1, nums + 1 + n);
  for (i = 1; i <= n; i++) {
    sums[i] = sums[i - 1] + (long long)nums[i];
  }
  for (i = 1; i <= n; i++) {
    best = 0;
    l = 1;
    r = n;
    while (l <= r) {
      mid = (l + r) / 2;
      if (i - mid < 1 || n - mid + 1 <= i) {
        r = mid - 1;
        continue;
      }
      cur.first =
          (long long)nums[i] + Sum(i - mid, i - 1) + Sum(n - mid + 1, n);
      cur.second = 2LL * mid + 1LL;
      prev.first =
          (long long)nums[i] + Sum(i - mid + 1, i - 1) + Sum(n - mid + 2, n);
      prev.second = 2LL * mid - 1LL;
      if (cur.first * prev.second > prev.first * cur.second) {
        best = mid;
        l = mid + 1;
      } else {
        r = mid - 1;
      }
    }
    cur.first =
        (long long)nums[i] + Sum(i - best, i - 1) + Sum(n - best + 1, n);
    cur.second = 2LL * best + 1LL;
    cur.first -= cur.second * (long long)nums[i];
    if (cur.first < 0) continue;
    if (cur.first * BestAns.second > BestAns.first * cur.second) {
      BestAns = cur;
      onecenter = true;
      center = i;
      dist = best;
    }
  }
  for (i = 1; i < n; i++) {
    best = 0;
    l = 1;
    r = n;
    while (l <= r) {
      mid = (l + r) / 2;
      if (i - mid < 1 || n - mid + 1 <= i + 1) {
        r = mid - 1;
        continue;
      }
      cur.first = (long long)nums[i] + (long long)nums[i + 1] +
                  Sum(i - mid, i - 1) + Sum(n - mid + 1, n);
      cur.second = 2LL * mid + 2LL;
      prev.first = (long long)nums[i] + (long long)nums[i + 1] +
                   Sum(i - mid + 1, i - 1) + Sum(n - mid + 2, n);
      prev.second = 2LL * mid;
      if (cur.first * prev.second > prev.first * cur.second) {
        best = mid;
        l = mid + 1;
      } else {
        r = mid - 1;
      }
    }
    cur.first = (long long)nums[i] + (long long)nums[i + 1] +
                Sum(i - best, i - 1) + Sum(n - best + 1, n);
    cur.second = 2LL * best + 2LL;
    cur.first -=
        (cur.second / 2) * ((long long)nums[i + 1] + (long long)nums[i]);
    if (cur.first < 0) continue;
    if (cur.first * BestAns.second > BestAns.first * cur.second) {
      BestAns = cur;
      onecenter = false;
      center = i;
      dist = best;
    }
  }
  if (onecenter) {
    printf("%d\n", dist * 2 + 1);
    for (i = center - dist; i <= center; i++) {
      if (i != center - dist) printf(" ");
      printf("%d", nums[i]);
    }
    for (i = n - dist + 1; i <= n; i++) {
      printf(" %d", nums[i]);
    }
    printf("\n");
  } else {
    printf("%d\n", dist * 2 + 2);
    for (i = center - dist; i <= center + 1; i++) {
      if (i != center - dist) printf(" ");
      printf("%d", nums[i]);
    }
    for (i = n - dist + 1; i <= n; i++) {
      printf(" %d", nums[i]);
    }
    printf("\n");
  }
  return 0;
}