#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; ++i) cin >> a[i];
  sort(a, a + n);
  long long c = 0;
  long long d = n - 1;
  for (long long i = 0; i < n; ++i) {
    if (i % 2 == 0)
      cout << a[c++] << " ";
    else
      cout << a[d--] << " ";
  }
  return 0;
}
