#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long a[n];
  for (int i = 0; i < n; ++i) cin >> a[i];
  sort(a, a + n);
  long long b[n];
  int j = 0;
  for (int i = 0; i < n; i += 2, ++j) b[j] = a[i];
  int i;
  if (n % 2 == 0)
    i = n - 1;
  else
    i = n - 2;
  for (; i > 0; i -= 2, ++j) b[j] = a[i];
  for (int i = 0; i < n; ++i) cout << b[i] << ' ';
  return 0;
}
