#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  cin >> n;
  vector<int> C;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    C.push_back(x);
  }
  sort(C.begin(), C.end());
  for (int i = n - 1; i >= 0; i -= 2) {
    cout << C[i] << " ";
  }
  int k;
  if (n & 1)
    k = 1;
  else
    k = 0;
  for (k; k < n; k += 2) {
    cout << C[k] << " ";
  }
  cout << endl;
}
