#include <bits/stdc++.h>
using namespace std;
vector<long long> a;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n;
  cin >> n;
  a.resize(n);
  for (long long i = 0; i < (n); ++i) cin >> a[i];
  sort((a).begin(), (a).end());
  long long c1 = 0;
  long long c2 = n - 1;
  while (c1 <= c2) {
    cout << a[c1++] << " ";
    if (c1 <= c2) {
      cout << a[c2--] << " ";
    }
  }
  cout << endl;
  return 0;
}
