#include <bits/stdc++.h>
using namespace std;
int n;
int h[109];
int st1[109], st2[109], top1, top2;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", h + i);
  sort(h + 1, h + n + 1);
  for (int i = 2; i <= n - 1; i++) {
    if (i & 1)
      st1[++top1] = h[i];
    else
      st2[++top2] = h[i];
  }
  printf("%d ", h[1]);
  for (int i = 1; i <= top1; i++) printf("%d ", st1[i]);
  printf("%d ", h[n]);
  for (int j = top2; j >= 1; j--) printf("%d ", st2[j]);
  return 0;
}
