#include <bits/stdc++.h>
using namespace std;
void solve() {
  vector<long long> v, ans;
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    long long q;
    cin >> q;
    v.push_back(q);
  }
  sort(v.begin(), v.end());
  bool cur = 0;
  while (!v.empty()) {
    if (!cur) {
      cout << v.front();
      v.erase(v.begin());
    } else {
      cout << v.back();
      v.erase(v.begin() + v.size() - 1);
    }
    cout << ' ';
    cur = 1 - cur;
  }
}
signed main() {
  long long t = 1;
  while (t--) solve();
}
