#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  int n;
  cin >> n;
  vector<int> a, g, ans(n);
  for (int i = 0; i < n; i++) {
    int b;
    cin >> b;
    a.push_back(b);
    g.push_back(b);
  }
  sort(a.begin(), a.end());
  sort(g.begin(), g.end(), greater<int>());
  int i = 0;
  int j = n - 1;
  while (i < j) {
    if (i % 2 == 0) {
      ans[i] = g[i];
      ans[j] = a[i];
    } else {
      ans[i] = a[i];
      ans[j] = g[i];
    }
    i++;
    j--;
  }
  if (i == j) ans[j] = a[j];
  for (int i = 0; i < n; i++) {
    if (i > 1 && i % 2 == 0 && i < (n / 2)) swap(ans[i], ans[n - i - 1]);
  }
  for (int i = 0; i < n; i++) cout << ans[i] << " ";
}
