#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<long long> a(n), x, y;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0) {
      x.push_back(a[i]);
    } else {
      y.push_back(a[i]);
    }
  }
  reverse(y.begin(), y.end());
  int l = 0, k = 0;
  for (auto it : x) {
    cout << it << " ";
  }
  for (auto it : y) {
    cout << it << " ";
  }
  cout << endl;
  return 0;
}
