#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n, i, j, x;
  vector<long long int> v;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> x;
    v.push_back(x);
  }
  sort(v.begin(), v.end());
  for (i = v.size() - 2; i >= 0; i = i - 2) {
    v.push_back(v[i]);
    v.erase(v.begin() + i);
  }
  for (i = 0; i < v.size(); i++) cout << v[i] << " ";
}
