#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  int n, i, mid, back;
  cin >> n;
  int arr[n];
  for (i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  mid = n / 2;
  back = n - 1;
  for (i = 0; i < mid; i++) cout << arr[i] << " " << arr[back - i] << " ";
  if (n % 2 == 1) cout << arr[mid];
  return 0;
}
