#include <bits/stdc++.h>
using namespace std;
void ti() {}
void print(deque<int> m) {
  auto i = m.begin();
  while (i != m.end()) {
    cout << *i << " ";
    i++;
  }
}
int main() {
  ti();
  int n;
  cin >> n;
  vector<int> v;
  while (n--) {
    int a;
    cin >> a;
    v.push_back(a);
  }
  sort(v.begin(), v.end());
  deque<int> o;
  for (int i = 0; i < v.size(); i++) {
    if (i % 2 != 0) {
      o.push_front(v[i]);
    } else {
      o.push_back(v[i]);
    }
  }
  print(o);
  return 0;
}
