#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  list<long long> l;
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0) {
      l.push_front(a[i]);
    } else {
      l.push_back(a[i]);
    }
  }
  for (auto itr = l.begin(); itr != l.end(); itr++) cout << *itr << " ";
  return 0;
}
