#include <bits/stdc++.h>
using namespace std;
int n, a[1005], h, t;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + 1 + n);
  h = 1, t = n;
  while (h < t) cout << a[h++] << " " << a[t--] << " ";
  if (h == t) cout << a[h];
  return 0;
}
