#include <bits/stdc++.h>
using namespace std;
bool sort1(pair<int, string> a, pair<int, string> b) {
  return a.first > b.first;
}
int main() {
  int n;
  cin >> n;
  int arr[n], ans[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  int lo = 0, hi = n - 1, flag = 1, i = 0;
  while (i < n) {
    if (flag) {
      ans[i++] = arr[lo];
      lo++;
      flag = 0;
    } else {
      ans[i++] = arr[hi];
      hi--;
      flag = 1;
    }
  }
  for (int i = 0; i < n; i++) cout << ans[i] << " ";
  return 0;
}
