#include <bits/stdc++.h>
using namespace std;
int x[103456];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> x[i];
  }
  sort(x, x + n);
  deque<int> cola;
  bool der = 1;
  for (int i = n - 1; i >= 0; i--) {
    if (der)
      cola.push_back(x[i]);
    else
      cola.push_front(x[i]);
    der ^= 1;
  }
  for (int i = 0; i < cola.size(); ++i) {
    cout << cola[i] << " ";
  }
}
