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