#include <bits/stdc++.h>
using namespace std;
int a[1005];
int b[10005], l, r;
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  sort(a + 1, a + n + 1);
  l = r = 5000;
  for (int i = 1; i <= n; ++i) {
    if (i & 1)
      b[r++] = a[i];
    else
      b[--l] = a[i];
  }
  for (int i = l; i < r; ++i) cout << b[i] << " ";
}
