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