#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t;
  t = 1;
  while (t--) {
    long long n, i, j, k, l, r;
    cin >> n;
    vector<long long> v, ans;
    for (i = 0; i < n; i++) {
      cin >> j;
      v.push_back(j);
    }
    ans = v;
    sort(v.begin(), v.end());
    ans[(n - 1) / 2] = v[n - 1];
    j = (n - 1) / 2 - 1;
    k = (n - 1) / 2 + 1;
    i = n - 2;
    while (i >= 0) {
      if (j >= 0) ans[j--] = v[i--];
      if (i >= 0 && k < n) ans[k++] = v[i--];
    }
    for (i = 0; i < n; i++) cout << ans[i] << " ";
  }
}
