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