#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  vector<int> v, v1;
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0)
      v.push_back(a[i]);
    else
      v1.push_back(a[i]);
  }
  for (int i = 0; i < v.size(); i++) {
    cout << v[i] << " ";
  }
  reverse(v1.begin(), v1.end());
  for (int i = 0; i < v1.size(); i++) {
    cout << v1[i] << " ";
  }
}
