#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, l, k, i;
  long long int a[2000], o[1000];
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  i = 0;
  o[0] = a[0];
  k = 1;
  i++;
  while (i < n - 1) {
    o[i + 1] = a[k];
    o[i] = a[k + 1];
    i = i + 2;
    k = k + 2;
  }
  o[i] = a[k];
  for (i = 0; i < n; i++) {
    cout << o[i] << " ";
  }
  return 0;
}
