#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  list<long long> h;
  while (n--) {
    long long k;
    cin >> k;
    h.push_back(k);
  }
  h.sort();
  list<long long> circle;
  bool left = true;
  for (long long k : h) {
    if (left)
      circle.push_front(k);
    else
      circle.push_back(k);
    left = !left;
  }
  while (!circle.empty()) {
    cout << circle.front();
    circle.pop_front();
    if (!circle.empty())
      cout << ' ';
    else
      cout << endl;
  }
  return 0;
}
