#include <bits/stdc++.h>
using namespace std;
bool a[200008];
int main() {
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  vector<int> v;
  for (int i = 0; i < n; i++)
    if (!(i % 2))
      v.push_back(arr[i]);
    else
      cout << arr[i] << " ";
  int sz = v.size();
  for (int i = sz - 1; i >= 0; i--) {
    cout << v[i] << " ";
  }
  return 0;
}
