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