#include <bits/stdc++.h>
using namespace std;
template <typename P, typename Q>
ostream& operator<<(ostream& os, pair<P, Q> p) {
  os << "(" << p.first << "," << p.second << ")";
  return os;
}
int main(int argc, char* argv[]) {
  int n;
  while (scanf("%d", &n) == 1) {
    vector<int> v;
    for (int i = 0; i < n; ++i) {
      int m;
      scanf("%d", &m);
      v.push_back(m);
    }
    sort(v.begin(), v.end());
    deque<int> q;
    for (auto& i : v) q.push_back(i);
    for (int i = 0; i < n; ++i) {
      int m;
      if (i % 2 && i) {
        m = q.back();
        q.pop_back();
      } else {
        m = q.front();
        q.pop_front();
      }
      if (i) printf(" ");
      printf("%d", m);
    }
    puts("");
  }
  return 0;
}
