#include <bits/stdc++.h>
template <class C>
inline void log_c(const C& c) {}
template <class C>
inline int sz(const C& c) {
  return static_cast<int>(c.size());
}
using namespace std;
using num = int32_t;
const std::string eol = "\n";
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int k = 0; k < (n); ++k) cin >> a.at(k);
  sort(begin(a), end(a));
  vector<int> b(n);
  for (int k = 0; k < (n + 1) / 2; ++k) {
    b.at(k) = a.at(2 * k);
  }
  for (int k = 0; k < n / 2; ++k) {
    b.at(n - 1 - k) = a.at(2 * k + 1);
  }
  copy(begin(b), end(b), ostream_iterator<int>(cout, " "));
  cout << endl;
  return 0;
}
