#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e9;
const int mod = (int)1e9 + 7;
const int MAX = (int)1e5 + 5;
int store[MAX];
int out[MAX];
int main(void) {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < (n); ++i) scanf("%d", store + i);
  sort(store, store + n);
  int m = n / 2;
  for (int i = 0; i < (n - m); ++i) out[i * 2] = store[i];
  for (int i = 0; i < (m); ++i) out[i * 2 + 1] = store[n - i - 1];
  for (int i = 0; i < (n); ++i) printf("%d ", out[i]);
  return 0;
}
