#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; ++i) cin >> a[i];
  sort(a, a + n);
  int i;
  for (i = 0; i < n; i += 2) {
    cout << a[i] << " ";
  }
  if (n % 2 == 0)
    i = n - 1;
  else
    i = n - 2;
  while (i >= 0) {
    cout << a[i] << " ";
    i -= 2;
  }
}
