You are given n points on a line with their coordinates xi. Find the point x so the sum of distances to the given points is minimal.

Input

The first line contains integer n (1 ≤ n ≤ 3·105) — the number of points on the line.

The second line contains n integers xi ( - 109 ≤ xi ≤ 109) — the coordinates of the given n points.

Output

Print the only integer x — the position of the optimal point on the line. If there are several optimal points print the position of the leftmost one. It is guaranteed that the answer is always the integer.

Example

Input

4
1 2 3 4


Output

2
/*
 * Code Author: Akshay Miterani
 * DA-IICT
 */
import java.io.*;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.*;



public class MainA {

	static double eps=(double)1e-6;
	static int mod=(int)1e9+7;
	public static void main(String args[]){
		InputReader in = new InputReader(System.in);
		OutputStream outputStream = System.out;
		PrintWriter out = new PrintWriter(outputStream);
		//----------My Code----------
		int n=in.nextInt();
		long adder=(long)1e9;
		long sum=0;
		Long a[]=new Long[n];
		for(int i=0;i<n;i++){
			a[i]=in.nextLong()+adder;
			sum+=a[i];
		}
		Arrays.sort(a);
		long ans=a[0],val=Long.MAX_VALUE,currleft=0;
		for(int i=0;i<n;i++){
			long left=i;
			long right=n-i-1;
			long sumright=(sum-a[i])-right*a[i];
			long sumleft=a[i]*left-(currleft);
			long sumhere=sumleft+sumright;
			if(sumhere<val){
				val=sumhere;
				ans=a[i];
			}
			//System.out.println(a[i]+" "+(sumhere)+" "+currleft+" "+sum+" "+ans);
			currleft+=a[i];
			sum-=a[i];
		}
		System.out.println(ans-adder);
		out.close();
		//---------------The End------------------

	}
	static boolean check(int x,int y){
		return x>=1 && x<=8 && y>=1 && y<=8;
	}
	static long gcd(long x, long y)
	{
		long r=0, a, b;
		a = (x > y) ? x : y; // a is greater number
		b = (x < y) ? x : y; // b is smaller number
		r = b;
		while(a % b != 0)
		{
			r = a % b;
			a = b;
			b = r;
		}
		return r;
	}

	public static void debug(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}

	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream inputstream) {
			reader = new BufferedReader(new InputStreamReader(inputstream));
			tokenizer = null;
		}

		public String nextLine(){
			String fullLine=null;
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					fullLine=reader.readLine();
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
				return fullLine;
			}
			return fullLine;
		}
		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}
		public long nextLong() {
			return Long.parseLong(next());
		}
		public int nextInt() {
			return Integer.parseInt(next());
		}
	}
}    