#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  sort(v.begin(), v.end());
  vector<int> z(n);
  int j = 0;
  int i;
  for (i = 0; i < ceil(n / 2.0); i++) {
    z[j] = v[i];
    j += 2;
  }
  j = 1;
  for (; i < n; i++) {
    z[j] = v[i];
    j += 2;
  }
  for (auto x : z) cout << x << " ";
}
