#include <bits/stdc++.h>
using namespace std;
void DBG() { cerr << endl; }
template <typename Start, typename... End>
void DBG(Start S, End... E) {
  cerr << " " << to_string(S);
  DBG(E...);
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  sort(v.begin(), v.end());
  int i = 0, j = v.size() - 1;
  while (i <= j) {
    if (i != j) {
      cout << v[i] << " " << v[j] << " ";
    } else {
      cout << v[i];
    }
    i++, j--;
  }
}
