#include <bits/stdc++.h>
using namespace std;
void scanint(long long int &x);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  scanint(n);
  long long int i = 0;
  long long int a[n];
  long long int j = 0;
  for (i = 0; i < n; i++) scanint(a[i]);
  sort(a, a + n);
  long long int ans[n];
  for (i = 0; i < n; i += 2, j++) ans[i] = a[j];
  for (i = 1; i < n; i += 2, j++) {
    ans[i] = a[j];
  }
  for (i = 0; i < n; i++) cout << ans[i] << " ";
  cout << endl;
  return 0;
}
void scanint(long long int &x) {
  register int c = getchar();
  x = 0;
  int neg = 0;
  for (; ((c < 48 || c > 57) && c != '-'); c = getchar())
    ;
  if (c == '-') {
    neg = 1;
    c = getchar();
  }
  for (; c > 47 && c < 58; c = getchar()) {
    x = (x << 1) + (x << 3) + c - 48;
  }
  if (neg) x = -x;
}
