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