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