#include <bits/stdc++.h>
using namespace std;
int mod = (int)(1e9) + 7;
void solve() {
  int n, m;
  cin >> n;
  vector<int> vc(n);
  for (int i = 0; i < n; ++i) cin >> vc[i];
  sort(vc.begin(), vc.end());
  for (int i = 0, j = n - 1, jj = 0; i < n; ++i) {
    if (i & 1) {
      cout << vc[j] << ' ';
      j--;
    } else {
      cout << vc[jj] << ' ';
      jj++;
    }
  }
  cout << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int tc;
  tc = 1;
  while (tc--) {
    solve();
  }
  return 0;
}
