#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  vector<long long> a(n), arr(n);
  for (long long &val : a) cin >> val;
  sort(a.rbegin(), a.rend());
  long long i = 1, j = 0;
  while (i < n) {
    arr[i] = a[j++];
    i += 2;
  }
  i = 0;
  while (i < n && j < n) {
    arr[i] = a[j++];
    i += 2;
  }
  for (long long val : arr) cout << val << ' ';
  return 0;
}
