#include <bits/stdc++.h>
using namespace std;
int n, a[1005], b[1005];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", a + i);
  sort(a + 1, a + n + 1, greater<int>());
  for (int i = 1; i <= n; ++i) {
    if (i & 1 && i != n)
      b[i + 1] = a[i];
    else if (i & 1)
      b[i] = a[i];
    else
      b[i - 1] = a[i];
  }
  for (int i = 1; i <= n; ++i) printf("%d ", b[i]);
  printf("\n");
  return 0;
}
