#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  int a[1005];
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (int unsorted = n; unsorted > 1; unsorted--) {
    for (int i = 1; i < unsorted; i++) {
      if (a[i] < a[i - 1]) {
        int temp = a[i];
        a[i] = a[i - 1];
        a[i - 1] = temp;
      }
    }
  }
  for (int i = 0, genap = 0, ganjil = n - 1; i < n; i++) {
    if (i % 2 == 0) {
      printf("%d ", a[genap++]);
    } else {
      printf("%d ", a[ganjil--]);
    }
  }
  return 0;
}
