#include <bits/stdc++.h>
using namespace std;
void swap(long long *a, long long *b) {
  long long temp = *a;
  *a = *b;
  *b = temp;
}
int main() {
  long long n;
  cin >> n;
  long long a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  int decision = 0;
  vector<int> pd1, pd2;
  for (int i = 0; i < n; i++) {
    if (decision % 2 == 0)
      pd1.push_back(a[i]);
    else
      pd2.push_back(a[i]);
    decision++;
  }
  for (int i = 0; i < pd1.size(); i++) {
    cout << pd1[i] << " ";
  }
  for (int i = pd2.size() - 1; i >= 0; i--) {
    cout << pd2[i] << " ";
  }
  cout << endl;
}
