#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k, l, m, n;
  cin >> n;
  int ar[n + 10];
  int ans[n + 10];
  for (i = 0; i < n; i++) cin >> ar[i];
  sort(ar, ar + n);
  j = 0;
  for (i = 0; i < n; i += 2) {
    ans[i] = ar[j], j++;
  }
  j = n - 1;
  for (i = 1; i < n; i += 2) ans[i] = ar[j], j--;
  for (i = 0; i < n; i++) cout << ans[i] << " ";
  cout << '\n';
}
