#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, j, k, l;
  long long *a, *b;
  scanf("%d", &n);
  a = (long long *)malloc(n * sizeof(long long));
  for (j = 0; j < n; j++) {
    scanf("%lld", &a[j]);
  }
  sort(a, a + n);
  for (j = n - 1; j >= 0; j -= 2) {
    printf("%lld ", a[j]);
  }
  for (j = (n % 2); j < n; j += 2) {
    printf("%lld ", a[j]);
  }
  return 0;
}
