#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    a.push_back(x);
  }
  sort(a.begin(), a.end());
  int l = 0;
  int r = n - 1;
  for (int i = 0; i < n; i++) {
    if (i % 2) {
      cout << a[r--] << " ";
    } else {
      cout << a[l++] << " ";
    }
  }
  return 0;
}
