#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int a[10000], n, t, k = 0, b[10000], c[100000], d = 0, e = 0;
  cin >> n;
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
    c[i] = a[i];
  }
  sort(c, c + n);
  k = n - 1;
  for (long long int i = 0; i < (n); i++) {
    d++;
    if (d % 2 != 0) {
      b[i] = c[e];
      e++;
    } else {
      b[i] = c[k];
    }
    if (d % 2 == 0) {
      k--;
      d = 0;
    }
  }
  for (long long int i = 0; i < n; i++) {
    cout << b[i] << " ";
  }
  return 0;
}
