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 JAVA):

Solution:


import java.io.*;
import java.util.*;
public class q5 {
	static long[] a;
	static long[] prefix;
	static int n;
	public static void main(String[] args) throws Exception
	{
		InputReader in=new InputReader(System.in);
		PrintWriter pw=new PrintWriter(System.out);
		n=in.nextInt();
		 a=new long[n];
	//	 Random ra=new Random();
		for(int i=0;i<n;i++)
		{
			a[i]=in.nextLong();
		}
		Arrays.sort(a);
		 prefix=new long[n+1];
		prefix[1]=a[0];
		for(int i=1;i<n;i++)
		{
			prefix[i+1]=prefix[i]+a[i];
		}
		Fraction bestans=new Fraction(0,1);
		int bestl=0;
		int bestsize=0;
		for(int i=0;i<n;i++)
		{
				int l=0;
				int r=Math.min(i,n-i-1);
				//System.out.println("for "+i+" "+l+" "+r);
				/*for(int k=l;k<=r;k++)
				{
					System.out.println("for i "+i+"  size "+k);
					System.out.println(function(i,k).num+" "+function(i,k).den);
				}*/
				while(r-l+1>3)
				{
					int mid1=l+(r-l)/3;
					int mid2=r-(r-l)/3;
					Fraction ans1=function(i,mid1);
					Fraction ans2=function(i,mid2);
					if(ans1.compareTo(ans2)<0)
					{
						if(ans1.compareTo(bestans)>0)
						{
							bestans=ans1;
							bestl=i;
							bestsize=mid1;
						}
						l=mid1;
					}
					else
					{
						if(ans2.compareTo(bestans)>0)
						{
							bestans=ans2;
							bestl=i;
							bestsize=mid2;
						}
						r=mid2;
					}
				}
				for(int j=l;j<=r;j++)
				{
					Fraction ans=function(i,j);
					//System.out.println("for i "+i+"  size "+j);
					//System.out.println(function(i,j).num+" "+function(i,j).den);
					if(ans.compareTo(bestans)>0)
					{
						bestans=ans;
						bestl=i;	
						bestsize=j;
					}
				}
		}
		//pw.println(function(1,0).num+" "+function(1,0).den);
		
		pw.println(2*bestsize+1);
		pw.print(a[bestl]+" ");
		/*for(int i=bestsize;i>0;i--)
		{
			pw.print(a[bestl-bestsize]+" ");
		}*/
		for(int i=bestsize;i>0;i--)
		{
			pw.print(a[bestl-i]+" ");
			pw.print(a[n-i]+" ");
		}
		
		

		
		
		pw.close();
	}
	public static Fraction function(int x,int size)
	{
		long ans=prefix[x]-prefix[x-size]+prefix[n]-prefix[n-size]-2*1l*size*a[x];
		return new Fraction(ans,2*size+1);
	}

static  class Fraction {
	
		long num, den;

		Fraction(long num, long den) {
			this.num = num;
			this.den = den;
		}

		public int compareTo(Fraction b) {
			return Long.compare(num * b.den, b.num * den);
		}
	
}
	
	
	
	
	
	
	
	
	 static class InputReader {

		private InputStream stream;
		private byte[] buf = new byte[8192];
		private int curChar;
		private int snumChars;
		private SpaceCharFilter filter;

		public InputReader(InputStream stream) {
			this.stream = stream;
		}

		public int snext() {
			if (snumChars == -1)
				throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try {
					snumChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public int nextInt() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = snext();
			}

			int res = 0;

			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = snext();
			} while (!isSpaceChar(c));

			return res * sgn;
		}
		
		public long nextLong() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = snext();
			}

			long res = 0;

			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = snext();
			} while (!isSpaceChar(c));

			return res * sgn;
		}
		
		public String readString() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = snext();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	}

}