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;
long long a[200005];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  sort(a, a + n);
  long long bu = -1, bd = 1, p = -1, q = -1;
  long long sum = a[0], cnt = 1;
  for (int i = 0; i < n; ++i) {
    while (i - cnt >= 0 && n - cnt > i) {
      if ((2 * cnt - 1) *
              (sum + a[i - cnt] + a[n - cnt] - (2 * cnt + 1) * a[i]) >
          (2 * cnt + 1) * (sum - (2 * cnt - 1) * a[i])) {
        sum += a[i - cnt] + a[n - cnt];
        ++cnt;
      } else {
        break;
      }
    }
    if ((2 * cnt - 1) * bu < bd * (sum - (2 * cnt - 1) * a[i])) {
      bu = sum - (2 * cnt - 1) * a[i];
      bd = (2 * cnt - 1);
      p = i;
      q = cnt;
    }
    if (n - cnt == i) {
      --cnt;
      sum -= a[i - cnt] + a[n - cnt];
    }
    sum -= a[i - cnt + 1];
    sum += a[i + 1];
    while (cnt > 1 && (2 * cnt - 1) * (sum - a[i - cnt + 2] - a[n - cnt + 1] -
                                       (2 * cnt - 3) * a[i + 1]) >
                          (2 * cnt - 3) * (sum - (2 * cnt - 1) * a[i + 1])) {
      --cnt;
      sum -= a[i - cnt + 1] + a[n - cnt];
    }
  }
  long long bu2 = -1, bd2 = 1, p2 = -1, q2 = -1;
  sum = a[0] + a[1], cnt = 1;
  for (int i = 0; i + 1 < n; ++i) {
    while (i - cnt >= 0 && n - cnt > i + 1) {
      if (((sum + a[i - cnt] + a[n - cnt]) - (cnt + 1) * (a[i + 1] + a[i])) *
              cnt >
          (sum - cnt * (a[i + 1] - a[i])) * (cnt + 1)) {
        sum += a[i - cnt] + a[n - cnt];
        ++cnt;
      } else {
        break;
      }
    }
    if (bu2 * 2 * cnt < bd2 * (sum - cnt * (a[i + 1] + a[i]))) {
      bu2 = sum - cnt * (a[i + 1] + a[i]);
      bd2 = 2 * cnt;
      p2 = i;
      q2 = cnt;
    }
    if (n - cnt == i + 1) {
      --cnt;
      sum -= a[i - cnt] + a[n - cnt];
    }
    sum -= a[i - cnt + 1];
    sum += a[i + 1];
    while (cnt > 1 && cnt * ((sum - a[i - cnt + 2] + a[n - cnt + 1]) -
                             (cnt - 1) * (a[i + 1] + a[i])) >
                          (cnt - 1) * (sum - cnt * (a[i + 1] - a[i]))) {
      --cnt;
      sum -= a[i - cnt + 1] + a[n - cnt];
    }
  }
  cerr << bu << " " << bd << endl;
  cerr << bu2 << " " << bd2 << endl;
  if (bu2 * bd < bu * bd2) {
    cout << 2 * q - 1 << endl;
    for (int i = 0; i < q - 1; ++i) {
      cout << a[p - i - 1] << " ";
    }
    cout << a[p] << " ";
    for (int i = 0; i < q - 1; ++i) {
      cout << a[n - i - 1] << " ";
    }
    cout << endl;
  } else {
    cout << 2 * q2 << endl;
    for (int i = 0; i < q2 - 1; ++i) {
      cout << a[p2 - i - 1] << " ";
    }
    cout << a[p2] << " ";
    cout << a[p2 + 1] << " ";
    for (int i = 0; i < q2 - 1; ++i) {
      cout << a[n - i - 1] << " ";
    }
    cout << endl;
  }
  return 0;
}