#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  deque<int> ans;
  for (int i = n - 1; i >= 0; i--) {
    if (i % 2)
      ans.push_back(a[i]);
    else
      ans.push_front(a[i]);
  }
  for (auto x : ans) cout << x << " ";
  cout << '\n';
}
