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