#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  for (long long i = 0; i < n; i += 2) {
    cout << a[i] << " ";
  }
  if (n % 2 != 0) {
    for (long long i = n - 2; i >= 0; i -= 2) {
      cout << a[i] << " ";
    }
  } else {
    for (long long i = n - 1; i >= 0; i -= 2) {
      cout << a[i] << " ";
    }
  }
  cout << endl;
}
