#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int &x : a) cin >> x;
  sort((a).begin(), (a).end());
  vector<int> L, R;
  for (int i = 0; i < n; ++i) {
    if (i + 1 < n) {
      L.push_back(a[i]);
      R.push_back(a[i + 1]);
      ++i;
    } else {
      L.push_back(a[i]);
    }
  }
  reverse((R).begin(), (R).end());
  for (int x : L) cout << x << ' ';
  for (int x : R) cout << x << ' ';
  cout << "\n";
}
