Cowboy Vlad has a birthday today! There are n children who came to the celebration. In order to greet Vlad, the children decided to form a circle around him. Among the children who came, there are both tall and low, so if they stand in a circle arbitrarily, it may turn out, that there is a tall and low child standing next to each other, and it will be difficult for them to hold hands. Therefore, children want to stand in a circle so that the maximum difference between the growth of two neighboring children would be minimal possible.

Formally, let's number children from 1 to n in a circle order, that is, for every i child with number i will stand next to the child with number i+1, also the child with number 1 stands next to the child with number n. Then we will call the discomfort of the circle the maximum absolute difference of heights of the children, who stand next to each other.

Please help children to find out how they should reorder themselves, so that the resulting discomfort is smallest possible.

Input

The first line contains a single integer n (2 ≤ n ≤ 100) — the number of the children who came to the cowboy Vlad's birthday.

The second line contains integers a_1, a_2, …, a_n (1 ≤ a_i ≤ 10^9) denoting heights of every child.

Output

Print exactly n integers — heights of the children in the order in which they should stand in a circle. You can start printing a circle with any child.

If there are multiple possible answers, print any of them.

Examples

Input


5
2 1 1 3 2


Output


1 2 3 2 1


Input


3
30 10 20


Output


10 20 30

Note

In the first example, the discomfort of the circle is equal to 1, since the corresponding absolute differences are 1, 1, 1 and 0. Note, that sequences [2, 3, 2, 1, 1] and [3, 2, 1, 1, 2] form the same circles and differ only by the selection of the starting point.

In the second example, the discomfort of the circle is equal to 20, since the absolute difference of 10 and 30 is equal to 20.
import static java.util.Arrays.*;
import static java.util.Comparator.*;

import java.util.*;
import java.util.ArrayList;

public class C {

	public Object solve () {
		int N = sc.nextInt();
		int [] A = sc.nextInts();

		sort(A);
		int [] res = null;
		int b = A[N-1] + 1;

		int p = 0, q = A[N-1], m;
		while (q - p > 1) {
			m = (p + q) / 2;
			int [] r = calc(A, m);
			if (r != null) {
				q = m;
				if (m < b) {
					b = m;
					res = r;
				}
			}
			else
				p = m;
		}

		return res;
	}

	int [] calc(int [] A, int m) {
		int N = A.length, M = N*N;
		int [] P = new int [M];
		fill(P, -1); P[0] = 0;

		for (int z : rep(N-1))
			for (int x : rep(z))
				for (int y : rep(z)) {
					int j = x*N + y;
					if (P[j] != -1) {
						if (A[z] - A[x] <= m) {
							int k = z*N + y;
							P[k] = j;
						}
						if (A[z] - A[y] <= m) {
							int k = x*N + z;
							P[k] = j;
						}
					}
				}

		for (int x : rep(N-1))
			for (int y : rep(N-1)) {
				int j = x*N + y;
				if (P[j] != -1 && A[N-1] - A[x] <= m && A[N-1] - A[y] <= m) {
					List<Integer> L = new ArrayList<>(), R = new ArrayList<>();
					boolean [] V = new boolean [N]; V[0] = V[N-1] = true;
					while (j != 0) {
						if (!V[x]) L.add(x);
						if (!V[y]) R.add(y);
						V[x] = V[y] = true;
						j = P[j]; x = j/N; y = j%N;
					}
					for (int i : rep(N))
						if (!V[i])
							L.add(i);
					Collections.sort(L); Collections.sort(R, reverseOrder());
					int [] res = new int [N]; res[0] = A[0]; int c = 1;
					for (int v : L)
						res[c++] = A[v];
					res[c++] = A[N-1];
					for (int v : R)
						res[c++] = A[v];
					return res;
				}
			}

		return null;
	}

	private static final int CONTEST_TYPE = 1;

	private static void init () {
	}

	private static final int MOD = (int) 1e9 + 7;
	private static long and (long x, int i) { return (x & bit(i)); }
	private static long bit (int i) { return (1L << i); }
	private static Integer [] boxed (int ... A) { return stream(A).mapToObj(x -> x).toArray(Integer[]::new); }
	private static boolean has (long x, int i) { return and(x, i) != 0; }
	long [][] identity (int N) {
		long [][] res = new long [N][N];
		for (int i = 0; i < N; ++i)
			res[i][i] = 1;
		return res;
	}
	private static long mod (long x, long mod) { return ((x % mod) + mod) % mod; }
	long [][] mod (long [][] A) { return mod(A, MOD); }
	long [][] mod (long [][] A, long mod) {
		int N = A.length, M = A[0].length;
		long [][] res = new long [N][M];
		for (int i = 0; i < N; ++i)
			for (int j = 0; j < M; ++j)
				res[i][j] = mod(A[i][j], mod);
		return res;
	}
	long [] modMult(long [][] A, long [] X) { return modMult(A, X, MOD); }
	long [] modMult (long [][] A, long [] X, long mod) {
		int N = A.length, M = X.length;
		assert A[0].length == M;
		long [] res = new long [N];
		for (int i = 0; i < N; ++i)
			for (int j = 0; j < M; ++j)
				res[i] = (res[i] + A[i][j] * X[j]) % mod;
		return res;
	}
	long [][] modMult (long [][] A, long [][] B, long mod) {
		int N = A.length, R = B.length, M = B[0].length;
		assert A[0].length == R;
		long [][] res = new long [N][M];

		for (int i = 0; i < N; ++i)
			for (int k = 0; k < M; ++k)
				for (int j = 0; j < R; ++j)
					res[i][k] = (res[i][k] + A[i][j] * B[j][k]) % mod;
		return res;
	}
	long [][] modPow (long [][] A, long N) { return modPow(A, N, MOD); }
	long [][] modPow (long [][] A, long N, long mod) {
		if (N == 0)
			return identity(A.length);
		int s = Long.numberOfTrailingZeros(Long.highestOneBit(N));
		long [][] res = A;
		for (int i = s-1; i >= 0; --i) {
			res = modMult(res, res, mod);
			if (has(N, i))
				res = modMult(res, A, mod);
		}
		return res;
	}
	private static int [] rep (int N) { return rep(0, N); }
	private static int [] rep (int S, int T) { if (S >= T) return new int [0]; int [] res = new int [T-S]; for (int i = S; i < T; ++i) res[i-S] = i; return res; }
	private static int [] sort (int [] A) { Integer [] AA = boxed(A); Collections.shuffle(asList(AA)); Arrays.sort(unboxed(AA, A)); return A; }
	private static int [] unboxed (Integer [] A) { return stream(A).mapToInt(x -> x).toArray(); }
	private static int [] unboxed (Integer [] A, int [] a) { System.arraycopy(unboxed(A), 0, a, 0, A.length); return a; }
	//////////////////////////////////////////////////////////////////////////////////// OFF
	private static IOUtils.MyScanner sc = new IOUtils.MyScanner();
	private static class IOUtils {
		public static class MyScanner {
			public String next () { newLine(); return line[index++]; }
			public int nextInt () { return Integer.parseInt(next()); }
			public String nextLine () { line = null; return readLine(); }
			public String [] nextStrings () { return split(nextLine()); }
			public int[] nextInts () { return nextStream().mapToInt(Integer::parseInt).toArray(); }
			//////////////////////////////////////////////
			private boolean eol () { return index == line.length; }
			private String readLine () {
				try {
					return r.readLine();
				} catch (Exception e) {
					throw new Error (e);
				}
			}
			private final java.io.BufferedReader r;
			private MyScanner () { this(new java.io.BufferedReader(new java.io.InputStreamReader(System.in))); }
			private MyScanner (java.io.BufferedReader r) {
				try {
					this.r = r;
					while (!r.ready())
						Thread.sleep(1);
					start();
				} catch (Exception e) {
					throw new Error(e);
				}
			}
			private String [] line;
			private int index;
			private void newLine () {
				if (line == null || eol()) {
					line = split(readLine());
					index = 0;
				}
			}
			private java.util.stream.Stream<String> nextStream () { return java.util.Arrays.stream(nextStrings()); }
			private String [] split (String s) { return s.length() > 0 ? s.split(" ") : new String [0]; }
		}
		private static String build (Object o, Object ... A) { return buildDelim(" ", o, A); }
		private static String buildDelim (String delim, Object o, Object ... A) {
			StringBuilder b = new StringBuilder();
			append(b, o, delim);
			for (Object p : A)
				append(b, p, delim);
			return b.substring(delim.length());
		}
		//////////////////////////////////////////////////////////////////////////////////
		private static final java.text.DecimalFormat formatter = new java.text.DecimalFormat("#.#########");
		private static void start () { if (t == 0) t = millis(); }
		private static void append (java.util.function.Consumer<Object> f, java.util.function.Consumer<Object> g, final Object o) {
			if (o.getClass().isArray()) {
				int len = java.lang.reflect.Array.getLength(o);
				for (int i = 0; i < len; ++i)
					f.accept(java.lang.reflect.Array.get(o, i));
			}
			else if (o instanceof Iterable<?>)
				((Iterable<?>)o).forEach(f::accept);
			else
				g.accept(o instanceof Double ? formatter.format(o) : o);
		}
		private static void append (final StringBuilder b, Object o, final String delim) {
			append(x -> { append(b, x, delim); }, x -> b.append(delim).append(x), o);
		}
		private static java.io.PrintWriter pw = new java.io.PrintWriter(System.out);
		private static void print (Object o, Object ... A) {
			String res = build(o, A);
			if (DEBUG == 2)
				err(res, '(', time(), ')');
			pw.println(res);
			if (DEBUG == 1) {
				pw.flush();
				System.out.flush();
			}
		}
		private static void err (Object o, Object ... A) { System.err.println(build(o, A)); }
		private static int DEBUG;
		private static void exit () {
			String end = "------------------" + System.lineSeparator() + time();
			switch(DEBUG) {
			case 1: print(end); break;
			case 2: err(end); break;
			}
			IOUtils.pw.close();
			System.out.flush();
			System.exit(0);
		}
		private static long t;
		private static long millis () { return System.currentTimeMillis(); }
		private static String time () { return "Time: " + (millis() - t) / 1000.0; }
		private static void run (int N) {
			try { DEBUG = Integer.parseInt(System.getProperties().get("DEBUG").toString()); }
			catch (Throwable t) {}

			for (int n = 1; n <= N; ++n) {
				Object res = new C().solve();
				if (res != null) {
					@SuppressWarnings("all")
					Object o = CONTEST_TYPE == 0 ? "Case #" + n + ": " + build(res) : res;
					print(o);
				}
			}
			exit();
		}
	}
	////////////////////////////////////////////////////////////////////////////////////
	public static void main (String[] args) {
		init();
		@SuppressWarnings("all")
		int N = CONTEST_TYPE == 1 ? 1 : sc.nextInt();
		IOUtils.run(N);
	}
}
